Skip to content

Commit 22692b9

Browse files
committed
Simplify definition of source and improve QLDoc
This is also slightly faster to evaluate (217s instead of 228s on apache/geode on my machine).
1 parent c6f4a20 commit 22692b9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ import semmle.code.java.frameworks.android.Compose
88
private import semmle.code.java.security.Sanitizers
99

1010
/** A variable that may hold sensitive information, judging by its name. */
11-
class CredentialExpr extends Expr {
11+
class VariableWithSensitiveName extends Variable {
12+
VariableWithSensitiveName() { this.getName().regexpMatch(getCommonSensitiveInfoRegex()) }
13+
}
14+
15+
/** A reference to a variable that may hold sensitive information, judging by its name. */
16+
class CredentialExpr extends VarAccess {
1217
CredentialExpr() {
13-
exists(Variable v | this = v.getAnAccess() |
14-
v.getName().regexpMatch(getCommonSensitiveInfoRegex()) and
15-
not this instanceof CompileTimeConstantExpr
16-
)
18+
this.getVariable() instanceof VariableWithSensitiveName and
19+
not this instanceof CompileTimeConstantExpr
1720
}
1821
}
1922

0 commit comments

Comments
 (0)