Skip to content

Commit 20eb39d

Browse files
committed
CPP: Bypass some of the complexity in 'toString'.
1 parent 6e6c169 commit 20eb39d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cpp/ql/src/semmle/code/cpp/security/SensitiveExprs.qll

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,12 @@ abstract class SensitiveExpr extends Expr { }
1919

2020
class SensitiveVarAccess extends SensitiveExpr {
2121
SensitiveVarAccess() {
22-
this instanceof VariableAccess and
23-
exists(string s | this.toString().toLowerCase() = s |
24-
suspicious(s)
25-
)
22+
suspicious(this.(VariableAccess).getTarget().getName().toLowerCase())
2623
}
2724
}
2825

2926
class SensitiveCall extends SensitiveExpr {
3027
SensitiveCall() {
31-
this instanceof FunctionCall and
32-
exists(string s | this.toString().toLowerCase() = s |
33-
suspicious(s)
34-
)
28+
suspicious(this.(FunctionCall).getTarget().getName().toLowerCase())
3529
}
3630
}

0 commit comments

Comments
 (0)