File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
cpp/ql/src/semmle/code/cpp/security Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,24 @@ private predicate suspicious(string s) {
1515 )
1616}
1717
18- abstract class SensitiveExpr extends Expr { }
18+ class SensitiveVariable extends Variable {
19+ SensitiveVariable ( )
20+ {
21+ suspicious ( getName ( ) .toLowerCase ( ) )
22+ }
23+ }
1924
20- class SensitiveVarAccess extends SensitiveExpr {
21- SensitiveVarAccess ( ) {
22- suspicious ( this .( VariableAccess ) .getTarget ( ) .getName ( ) .toLowerCase ( ) )
25+ class SensitiveFunction extends Function {
26+ SensitiveFunction ( )
27+ {
28+ suspicious ( getName ( ) .toLowerCase ( ) )
2329 }
2430}
2531
26- class SensitiveCall extends SensitiveExpr {
27- SensitiveCall ( ) {
28- suspicious ( this .( FunctionCall ) .getTarget ( ) .getName ( ) .toLowerCase ( ) )
32+ class SensitiveExpr extends Expr {
33+ SensitiveExpr ( )
34+ {
35+ this .( VariableAccess ) .getTarget ( ) instanceof SensitiveVariable or
36+ this .( FunctionCall ) .getTarget ( ) instanceof SensitiveFunction
2937 }
3038}
You can’t perform that action at this time.
0 commit comments