CPP: Bypass some of the complexity in 'toString'.

This commit is contained in:
Geoffrey White
2019-12-03 10:44:59 +00:00
parent 6e6c1693f4
commit 20eb39d37e

View File

@@ -19,18 +19,12 @@ abstract class SensitiveExpr extends Expr { }
class SensitiveVarAccess extends SensitiveExpr {
SensitiveVarAccess() {
this instanceof VariableAccess and
exists(string s | this.toString().toLowerCase() = s |
suspicious(s)
)
suspicious(this.(VariableAccess).getTarget().getName().toLowerCase())
}
}
class SensitiveCall extends SensitiveExpr {
SensitiveCall() {
this instanceof FunctionCall and
exists(string s | this.toString().toLowerCase() = s |
suspicious(s)
)
suspicious(this.(FunctionCall).getTarget().getName().toLowerCase())
}
}