Skip to content

Commit 921c41d

Browse files
ihsinmegeoffw0
andauthored
Apply suggestions from code review
Co-authored-by: Geoffrey White <[email protected]>
1 parent 2b1b948 commit 921c41d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-020/LateCheckOfFunctionArgument.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import cpp
1616
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
1717

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. */
1919
predicate numberArgument(Function f, int apos) {
2020
f.hasGlobalOrStdName("write") and apos = 2
2121
or
@@ -54,7 +54,7 @@ class IfCompareWithZero extends IfStmt {
5454

5555
from FunctionCall fc, IfCompareWithZero ifc, int na
5656
where
57-
numberArgument(fc.getTarget(), na)
57+
numberArgument(fc.getTarget(), na) and
5858
globalValueNumber(fc.getArgument(na)) = globalValueNumber(ifc.noZerroOperand()) and
5959
dominates(fc, ifc) and
6060
not exists(IfStmt ifc1 |

0 commit comments

Comments
 (0)