Skip to content

Commit af07efe

Browse files
committed
C++: Accept test changes.
1 parent f0a1742 commit af07efe

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ edges
129129
| test.cpp:271:14:271:21 | ... + ... | test.cpp:271:14:271:21 | ... + ... |
130130
| test.cpp:271:14:271:21 | ... + ... | test.cpp:274:5:274:10 | ... = ... |
131131
| test.cpp:271:14:271:21 | ... + ... | test.cpp:274:5:274:10 | ... = ... |
132-
| test.cpp:304:15:304:26 | new[] | test.cpp:308:5:308:29 | ... = ... |
133132
| test.cpp:355:14:355:27 | new[] | test.cpp:356:15:356:23 | ... + ... |
134133
| test.cpp:355:14:355:27 | new[] | test.cpp:356:15:356:23 | ... + ... |
135134
| test.cpp:355:14:355:27 | new[] | test.cpp:357:24:357:30 | ... + ... |
@@ -214,7 +213,6 @@ edges
214213
| test.cpp:543:14:543:27 | new[] | test.cpp:548:5:548:19 | ... = ... |
215214
| test.cpp:554:14:554:27 | new[] | test.cpp:559:5:559:19 | ... = ... |
216215
| test.cpp:642:14:642:31 | new[] | test.cpp:647:5:647:19 | ... = ... |
217-
| test.cpp:667:14:667:31 | new[] | test.cpp:675:7:675:23 | ... = ... |
218216
| test.cpp:695:13:695:26 | new[] | test.cpp:698:5:698:10 | ... += ... |
219217
| test.cpp:695:13:695:26 | new[] | test.cpp:698:5:698:10 | ... += ... |
220218
| test.cpp:698:5:698:10 | ... += ... | test.cpp:698:5:698:10 | ... += ... |
@@ -316,8 +314,6 @@ nodes
316314
| test.cpp:271:14:271:21 | ... + ... | semmle.label | ... + ... |
317315
| test.cpp:271:14:271:21 | ... + ... | semmle.label | ... + ... |
318316
| test.cpp:274:5:274:10 | ... = ... | semmle.label | ... = ... |
319-
| test.cpp:304:15:304:26 | new[] | semmle.label | new[] |
320-
| test.cpp:308:5:308:29 | ... = ... | semmle.label | ... = ... |
321317
| test.cpp:355:14:355:27 | new[] | semmle.label | new[] |
322318
| test.cpp:356:15:356:23 | ... + ... | semmle.label | ... + ... |
323319
| test.cpp:356:15:356:23 | ... + ... | semmle.label | ... + ... |
@@ -367,8 +363,6 @@ nodes
367363
| test.cpp:559:5:559:19 | ... = ... | semmle.label | ... = ... |
368364
| test.cpp:642:14:642:31 | new[] | semmle.label | new[] |
369365
| test.cpp:647:5:647:19 | ... = ... | semmle.label | ... = ... |
370-
| test.cpp:667:14:667:31 | new[] | semmle.label | new[] |
371-
| test.cpp:675:7:675:23 | ... = ... | semmle.label | ... = ... |
372366
| test.cpp:695:13:695:26 | new[] | semmle.label | new[] |
373367
| test.cpp:698:5:698:10 | ... += ... | semmle.label | ... += ... |
374368
| test.cpp:698:5:698:10 | ... += ... | semmle.label | ... += ... |
@@ -399,7 +393,6 @@ subpaths
399393
| test.cpp:254:9:254:16 | ... = ... | test.cpp:248:24:248:30 | 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:24:248:30 | call to realloc | call to realloc | test.cpp:254:11:254:11 | i | i |
400394
| 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 |
401395
| 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 |
402-
| test.cpp:308:5:308:29 | ... = ... | test.cpp:304:15:304:26 | new[] | test.cpp:308:5:308:29 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:304:15:304:26 | new[] | new[] | test.cpp:308:8:308:10 | ... + ... | ... + ... |
403396
| test.cpp:358:14:358:26 | * ... | test.cpp:355:14:355:27 | new[] | test.cpp:358:14:358:26 | * ... | 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 |
404397
| test.cpp:359:14:359:32 | * ... | test.cpp:355:14:355:27 | new[] | test.cpp:359:14:359:32 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@ + 2. | test.cpp:355:14:355:27 | new[] | new[] | test.cpp:356:20:356:23 | size | size |
405398
| test.cpp:384:13:384:16 | * ... | test.cpp:377:14:377:27 | new[] | test.cpp:384:13:384:16 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:377:14:377:27 | new[] | new[] | test.cpp:378:20:378:23 | size | size |
@@ -411,6 +404,5 @@ subpaths
411404
| test.cpp:548:5:548:19 | ... = ... | test.cpp:543:14:543:27 | new[] | test.cpp:548:5:548:19 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:543:14:543:27 | new[] | new[] | test.cpp:548:8:548:14 | src_pos | src_pos |
412405
| test.cpp:559:5:559:19 | ... = ... | test.cpp:554:14:554:27 | new[] | test.cpp:559:5:559:19 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:554:14:554:27 | new[] | new[] | test.cpp:559:8:559:14 | src_pos | src_pos |
413406
| test.cpp:647:5:647:19 | ... = ... | test.cpp:642:14:642:31 | new[] | test.cpp:647:5:647:19 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:642:14:642:31 | new[] | new[] | test.cpp:647:8:647:14 | src_pos | src_pos |
414-
| test.cpp:675:7:675:23 | ... = ... | test.cpp:667:14:667:31 | new[] | test.cpp:675:7:675:23 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:667:14:667:31 | new[] | new[] | test.cpp:675:10:675:18 | ... ++ | ... ++ |
415407
| test.cpp:701:15:701:16 | * ... | test.cpp:695:13:695:26 | new[] | test.cpp:701:15:701:16 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:695:13:695:26 | new[] | new[] | test.cpp:696:19:696:22 | size | size |
416408
| test.cpp:706:12:706:13 | * ... | test.cpp:711:13:711:26 | new[] | test.cpp:706:12:706:13 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:711:13:711:26 | new[] | new[] | test.cpp:712:19:712:22 | size | size |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void test21() {
305305

306306
for (int i = 0; i < n; i += 2) {
307307
xs[i] = test21_get(i); // GOOD
308-
xs[i+1] = test21_get(i+1); // $ alloc=L304 alloc=L304-1 deref=L308 // GOOD [FALSE POSITIVE]
308+
xs[i+1] = test21_get(i+1); // GOOD
309309
}
310310
}
311311

@@ -672,7 +672,7 @@ void test33(unsigned size, unsigned src_pos)
672672
while (dst_pos < size - 1) {
673673
dst_pos++;
674674
if (true)
675-
xs[dst_pos++] = 0; // $ alloc=L667+1 deref=L675 // GOOD [FALSE POSITIVE]
675+
xs[dst_pos++] = 0; // GOOD
676676
}
677677
}
678678

0 commit comments

Comments
 (0)