Skip to content

Commit 9a139ea

Browse files
committed
C++: Accept test changes.
1 parent 57d3f3f commit 9a139ea

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-193/InvalidPointerDeref.expected

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ edges
4646
| test.cpp:206:17:206:23 | ... + ... | test.cpp:213:5:213:13 | ... = ... |
4747
| test.cpp:231:18:231:30 | new[] | test.cpp:232:3:232:20 | ... = ... |
4848
| test.cpp:238:20:238:32 | new[] | test.cpp:239:5:239:22 | ... = ... |
49-
| test.cpp:248:13:248:36 | call to realloc | test.cpp:254:9:254:16 | ... = ... |
5049
| test.cpp:260:13:260:24 | new[] | test.cpp:261:14:261:21 | ... + ... |
5150
| test.cpp:260:13:260:24 | new[] | test.cpp:261:14:261:21 | ... + ... |
5251
| test.cpp:260:13:260:24 | new[] | test.cpp:264:13:264:14 | * ... |
@@ -215,8 +214,6 @@ nodes
215214
| test.cpp:232:3:232:20 | ... = ... | semmle.label | ... = ... |
216215
| test.cpp:238:20:238:32 | new[] | semmle.label | new[] |
217216
| test.cpp:239:5:239:22 | ... = ... | semmle.label | ... = ... |
218-
| test.cpp:248:13:248:36 | call to realloc | semmle.label | call to realloc |
219-
| test.cpp:254:9:254:16 | ... = ... | semmle.label | ... = ... |
220217
| test.cpp:260:13:260:24 | new[] | semmle.label | new[] |
221218
| test.cpp:261:14:261:21 | ... + ... | semmle.label | ... + ... |
222219
| test.cpp:261:14:261:21 | ... + ... | semmle.label | ... + ... |
@@ -322,7 +319,6 @@ subpaths
322319
| test.cpp:213:5:213:13 | ... = ... | test.cpp:205:15:205:33 | call to malloc | test.cpp:213:5:213:13 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:205:15:205:33 | call to malloc | call to malloc | test.cpp:206:21:206:23 | len | len |
323320
| test.cpp:232:3:232:20 | ... = ... | test.cpp:231:18:231:30 | new[] | test.cpp:232:3:232:20 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:231:18:231:30 | new[] | new[] | test.cpp:232:11:232:15 | index | index |
324321
| test.cpp:239:5:239:22 | ... = ... | test.cpp:238:20:238:32 | new[] | test.cpp:239:5:239:22 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:238:20:238:32 | new[] | new[] | test.cpp:239:13:239:17 | index | index |
325-
| test.cpp:254:9:254:16 | ... = ... | test.cpp:248:13:248:36 | call to realloc | test.cpp:254:9:254:16 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:248:13:248:36 | call to realloc | call to realloc | test.cpp:254:11:254:11 | i | i |
326322
| test.cpp:264:13:264:14 | * ... | test.cpp:260:13:260:24 | new[] | test.cpp:264:13:264:14 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:260:13:260:24 | new[] | new[] | test.cpp:261:19:261:21 | len | len |
327323
| test.cpp:274:5:274:10 | ... = ... | test.cpp:270:13:270:24 | new[] | test.cpp:274:5:274:10 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:270:13:270:24 | new[] | new[] | test.cpp:271:19:271:21 | len | len |
328324
| test.cpp:358:14:358:26 | end_plus_one indirection | test.cpp:355:14:355:27 | new[] | test.cpp:358:14:358:26 | end_plus_one indirection | This read might be out of bounds, as the pointer might be equal to $@ + $@ + 1. | test.cpp:355:14:355:27 | new[] | new[] | test.cpp:356:20:356:23 | size | size |

cpp/ql/test/query-tests/Security/CWE/CWE-193/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void test17(unsigned *p, unsigned x, unsigned k) {
251251
// The following access is okay because:
252252
// n = 3*p[0] + k >= p[0] + k >= p[1] + k > p[1] = i
253253
// (where p[0] denotes the original value for p[0])
254-
p[i] = x; // $ alloc=L248 deref=L254 // GOOD [FALSE POSITIVE]
254+
p[i] = x; // GOOD
255255
}
256256
}
257257

0 commit comments

Comments
 (0)