mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
CPP: Add local dataflow to (one bit of) OverflowStatic.ql.
This commit is contained in:
@@ -6,3 +6,4 @@
|
||||
| test.cpp:20:3:20:12 | access to array | Potential buffer-overflow: counter 'i' <= 3 but 'buffer2' has 3 elements. |
|
||||
| test.cpp:24:27:24:27 | 4 | Potential buffer-overflow: 'buffer1' has size 3 not 4. |
|
||||
| test.cpp:26:27:26:27 | 4 | Potential buffer-overflow: 'buffer2' has size 3 not 4. |
|
||||
| test.cpp:40:22:40:27 | amount | Potential buffer-overflow: 'buffer' has size 100 not 101. |
|
||||
|
||||
@@ -37,7 +37,7 @@ void f2(char *src)
|
||||
amount = amount + 1;
|
||||
memcpy(buffer, src, amount); // BAD [NOT DETECTED]
|
||||
amount = 101;
|
||||
memcpy(buffer, src, amount); // BAD [NOT DETECTED]
|
||||
memcpy(buffer, src, amount); // BAD
|
||||
|
||||
ptr = buffer;
|
||||
memcpy(ptr, src, 101); // BAD [NOT DETECTED]
|
||||
|
||||
Reference in New Issue
Block a user