mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
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:
committed by
GitHub
parent
432c0b508a
commit
1372ee7a44
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user