File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
cpp/ql/src/experimental/Security/CWE/CWE-020 Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 15
15
import cpp
16
16
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
17
17
18
- / * * Pridekat allows you to get the number of the argument used for positioning in the buffer by the name of the function . * /
18
+ /** Holds for a function `f` that has an argument at index `apos` used for positioning in a buffer. */
19
19
predicate numberArgument ( Function f , int apos ) {
20
20
f .hasGlobalOrStdName ( "write" ) and apos = 2
21
21
or
@@ -54,7 +54,7 @@ class IfCompareWithZero extends IfStmt {
54
54
55
55
from FunctionCall fc , IfCompareWithZero ifc , int na
56
56
where
57
- numberArgument ( fc .getTarget ( ) , na )
57
+ numberArgument ( fc .getTarget ( ) , na ) and
58
58
globalValueNumber ( fc .getArgument ( na ) ) = globalValueNumber ( ifc .noZerroOperand ( ) ) and
59
59
dominates ( fc , ifc ) and
60
60
not exists ( IfStmt ifc1 |
You can’t perform that action at this time.
0 commit comments