Skip to content

Commit 1372ee7

Browse files
MathiasVPgeoffw0
andauthored
Update cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/pointer-deref/test.cpp
Co-authored-by: Geoffrey White <[email protected]>
1 parent 432c0b5 commit 1372ee7

File tree

1 file changed

+2
-1
lines changed
  • cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/pointer-deref

1 file changed

+2
-1
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/pointer-deref/test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ void test17(unsigned *p, unsigned x, unsigned k) {
249249
p[0] = n;
250250
unsigned i = p[1];
251251
// The following access is okay because:
252-
// n = 2*p[0] + k >= p[0] + k >= p[1] + k > p[1] = i
252+
// n = 3*p[0] + k >= p[0] + k >= p[1] + k > p[1] = i
253+
// (where p[0] denotes the original value for p[0])
253254
p[i] = x; // GOOD [FALSE POSITIVE]
254255
}
255256
}

0 commit comments

Comments
 (0)