Skip to content

Commit c7efde3

Browse files
committed
Remove variables with "null" in their name as sources
1 parent bf22c6d commit c7efde3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java/ql/lib/semmle/code/java/security/SensitiveLoggingQuery.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ private import semmle.code.java.security.Sanitizers
99

1010
/** A variable that may hold sensitive information, judging by its name. */
1111
class VariableWithSensitiveName extends Variable {
12-
VariableWithSensitiveName() { this.getName().regexpMatch(getCommonSensitiveInfoRegex()) }
12+
VariableWithSensitiveName() {
13+
exists(string name | name = this.getName() |
14+
name.regexpMatch(getCommonSensitiveInfoRegex()) and
15+
not name.regexpMatch("(?i).*null.*")
16+
)
17+
}
1318
}
1419

1520
/** A reference to a variable that may hold sensitive information, judging by its name. */

0 commit comments

Comments
 (0)