Skip to content

Commit de1f81a

Browse files
committed
C++: Accept test changes.
1 parent f20a690 commit de1f81a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-119/OverrunWriteProductFlow.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,5 @@ subpaths
426426
| test.cpp:199:9:199:15 | call to strncpy | test.cpp:147:19:147:24 | call to malloc | test.cpp:199:22:199:27 | string | This write may overflow $@ by 2 elements. | test.cpp:199:22:199:27 | string | string |
427427
| test.cpp:203:9:203:15 | call to strncpy | test.cpp:147:19:147:24 | call to malloc | test.cpp:203:22:203:27 | string | This write may overflow $@ by 2 elements. | test.cpp:203:22:203:27 | string | string |
428428
| test.cpp:207:9:207:15 | call to strncpy | test.cpp:147:19:147:24 | call to malloc | test.cpp:207:22:207:27 | string | This write may overflow $@ by 3 elements. | test.cpp:207:22:207:27 | string | string |
429-
| test.cpp:232:3:232:8 | call to memset | test.cpp:228:43:228:48 | call to malloc | test.cpp:232:10:232:15 | buffer | This write may overflow $@ by 32 elements. | test.cpp:232:10:232:15 | buffer | buffer |
430429
| test.cpp:243:5:243:10 | call to memset | test.cpp:241:27:241:32 | call to malloc | test.cpp:243:12:243:21 | string | This write may overflow $@ by 1 element. | test.cpp:243:16:243:21 | string | string |
431430
| test.cpp:250:5:250:10 | call to memset | test.cpp:249:20:249:27 | call to my_alloc | test.cpp:250:12:250:12 | p | This write may overflow $@ by 1 element. | test.cpp:250:12:250:12 | p | p |
432-
| test.cpp:257:5:257:10 | call to memset | test.cpp:256:17:256:22 | call to malloc | test.cpp:257:12:257:12 | p | This write may overflow $@ by 32 elements. | test.cpp:257:12:257:12 | p | p |

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-119/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void repeated_alerts(unsigned size, unsigned offset) {
229229
while(unknown()) {
230230
++size;
231231
}
232-
memset(buffer, 0, size); // BAD
232+
memset(buffer, 0, size); // BAD [NOT DETECTED]
233233
}
234234

235235
void set_string(string_t* p_str, char* buffer) {
@@ -254,6 +254,6 @@ void test6(unsigned long n, char *p) {
254254
while (unknown()) {
255255
n++;
256256
p = (char *)malloc(n);
257-
memset(p, 0, n); // GOOD [FALSE POSITIVE]
257+
memset(p, 0, n); // GOOD
258258
}
259259
}

0 commit comments

Comments
 (0)