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

Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
Mathias Vorreiter Pedersen
2023-04-27 17:10:44 +01:00
committed by GitHub
parent 432c0b508a
commit 1372ee7a44

View File

@@ -249,7 +249,8 @@ void test17(unsigned *p, unsigned x, unsigned k) {
p[0] = n;
unsigned i = p[1];
// The following access is okay because:
// n = 2*p[0] + k >= p[0] + k >= p[1] + k > p[1] = i
// n = 3*p[0] + k >= p[0] + k >= p[1] + k > p[1] = i
// (where p[0] denotes the original value for p[0])
p[i] = x; // GOOD [FALSE POSITIVE]
}
}