Skip to content

Commit c1077fe

Browse files
committed
C++: Accept test changes.
1 parent 9d5b8cf commit c1077fe

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -783,26 +783,16 @@ edges
783783
| test.cpp:407:7:407:8 | xs | test.cpp:407:3:407:18 | access to array |
784784
| test.cpp:407:7:407:8 | xs indirection | test.cpp:407:7:407:8 | xs |
785785
| test.cpp:417:16:417:33 | new[] | test.cpp:419:7:419:8 | xs |
786-
| test.cpp:419:7:419:8 | xs | test.cpp:419:7:419:11 | access to array |
787-
| test.cpp:419:7:419:11 | access to array | test.cpp:419:7:419:15 | Store: ... = ... |
788786
| test.cpp:427:14:427:27 | new[] | test.cpp:433:5:433:6 | xs |
789-
| test.cpp:433:5:433:6 | xs | test.cpp:433:5:433:17 | access to array |
790-
| test.cpp:433:5:433:17 | access to array | test.cpp:433:5:433:21 | Store: ... = ... |
791787
| test.cpp:439:14:439:27 | new[] | test.cpp:444:5:444:6 | xs |
792-
| test.cpp:444:5:444:6 | xs | test.cpp:444:5:444:15 | access to array |
793-
| test.cpp:444:5:444:15 | access to array | test.cpp:444:5:444:19 | Store: ... = ... |
794788
| test.cpp:450:14:450:27 | new[] | test.cpp:455:5:455:6 | xs |
795789
| test.cpp:455:5:455:6 | xs | test.cpp:455:5:455:15 | access to array |
796790
| test.cpp:455:5:455:15 | access to array | test.cpp:455:5:455:19 | Store: ... = ... |
797791
| test.cpp:461:14:461:27 | new[] | test.cpp:466:5:466:6 | xs |
798792
| test.cpp:466:5:466:6 | xs | test.cpp:466:5:466:15 | access to array |
799793
| test.cpp:466:5:466:15 | access to array | test.cpp:466:5:466:19 | Store: ... = ... |
800794
| test.cpp:472:14:472:27 | new[] | test.cpp:477:5:477:6 | xs |
801-
| test.cpp:477:5:477:6 | xs | test.cpp:477:5:477:15 | access to array |
802-
| test.cpp:477:5:477:15 | access to array | test.cpp:477:5:477:19 | Store: ... = ... |
803795
| test.cpp:483:14:483:27 | new[] | test.cpp:488:5:488:6 | xs |
804-
| test.cpp:488:5:488:6 | xs | test.cpp:488:5:488:15 | access to array |
805-
| test.cpp:488:5:488:15 | access to array | test.cpp:488:5:488:19 | Store: ... = ... |
806796
| test.cpp:494:14:494:31 | new[] | test.cpp:499:5:499:6 | xs |
807797
| test.cpp:505:14:505:31 | new[] | test.cpp:510:5:510:6 | xs |
808798
| test.cpp:516:14:516:31 | new[] | test.cpp:521:5:521:6 | xs |
@@ -1174,16 +1164,10 @@ nodes
11741164
| test.cpp:407:7:407:8 | xs indirection | semmle.label | xs indirection |
11751165
| test.cpp:417:16:417:33 | new[] | semmle.label | new[] |
11761166
| test.cpp:419:7:419:8 | xs | semmle.label | xs |
1177-
| test.cpp:419:7:419:11 | access to array | semmle.label | access to array |
1178-
| test.cpp:419:7:419:15 | Store: ... = ... | semmle.label | Store: ... = ... |
11791167
| test.cpp:427:14:427:27 | new[] | semmle.label | new[] |
11801168
| test.cpp:433:5:433:6 | xs | semmle.label | xs |
1181-
| test.cpp:433:5:433:17 | access to array | semmle.label | access to array |
1182-
| test.cpp:433:5:433:21 | Store: ... = ... | semmle.label | Store: ... = ... |
11831169
| test.cpp:439:14:439:27 | new[] | semmle.label | new[] |
11841170
| test.cpp:444:5:444:6 | xs | semmle.label | xs |
1185-
| test.cpp:444:5:444:15 | access to array | semmle.label | access to array |
1186-
| test.cpp:444:5:444:19 | Store: ... = ... | semmle.label | Store: ... = ... |
11871171
| test.cpp:450:14:450:27 | new[] | semmle.label | new[] |
11881172
| test.cpp:455:5:455:6 | xs | semmle.label | xs |
11891173
| test.cpp:455:5:455:15 | access to array | semmle.label | access to array |
@@ -1194,12 +1178,8 @@ nodes
11941178
| test.cpp:466:5:466:19 | Store: ... = ... | semmle.label | Store: ... = ... |
11951179
| test.cpp:472:14:472:27 | new[] | semmle.label | new[] |
11961180
| test.cpp:477:5:477:6 | xs | semmle.label | xs |
1197-
| test.cpp:477:5:477:15 | access to array | semmle.label | access to array |
1198-
| test.cpp:477:5:477:19 | Store: ... = ... | semmle.label | Store: ... = ... |
11991181
| test.cpp:483:14:483:27 | new[] | semmle.label | new[] |
12001182
| test.cpp:488:5:488:6 | xs | semmle.label | xs |
1201-
| test.cpp:488:5:488:15 | access to array | semmle.label | access to array |
1202-
| test.cpp:488:5:488:19 | Store: ... = ... | semmle.label | Store: ... = ... |
12031183
| test.cpp:494:14:494:31 | new[] | semmle.label | new[] |
12041184
| test.cpp:499:5:499:6 | xs | semmle.label | xs |
12051185
| test.cpp:505:14:505:31 | new[] | semmle.label | new[] |
@@ -1242,11 +1222,6 @@ subpaths
12421222
| test.cpp:384:13:384:16 | Load: * ... | test.cpp:377:14:377:27 | new[] | test.cpp:384:13:384:16 | Load: * ... | 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 |
12431223
| test.cpp:395:5:395:13 | Store: ... = ... | test.cpp:388:14:388:27 | new[] | test.cpp:395:5:395:13 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:388:14:388:27 | new[] | new[] | test.cpp:389:19:389:22 | size | size |
12441224
| test.cpp:407:3:407:22 | Store: ... = ... | test.cpp:404:12:404:25 | new[] | test.cpp:407:3:407:22 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:404:12:404:25 | new[] | new[] | test.cpp:407:10:407:17 | ... - ... | ... - ... |
1245-
| test.cpp:419:7:419:15 | Store: ... = ... | test.cpp:417:16:417:33 | new[] | test.cpp:419:7:419:15 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:417:16:417:33 | new[] | new[] | test.cpp:419:10:419:10 | i | i |
1246-
| test.cpp:433:5:433:21 | Store: ... = ... | test.cpp:427:14:427:27 | new[] | test.cpp:433:5:433:21 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:427:14:427:27 | new[] | new[] | test.cpp:433:8:433:16 | ... ++ | ... ++ |
1247-
| test.cpp:444:5:444:19 | Store: ... = ... | test.cpp:439:14:439:27 | new[] | test.cpp:444:5:444:19 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:439:14:439:27 | new[] | new[] | test.cpp:444:8:444:14 | src_pos | src_pos |
12481225
| test.cpp:455:5:455:19 | Store: ... = ... | test.cpp:450:14:450:27 | new[] | test.cpp:455:5:455:19 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:450:14:450:27 | new[] | new[] | test.cpp:455:8:455:14 | src_pos | src_pos |
12491226
| test.cpp:466:5:466:19 | Store: ... = ... | test.cpp:461:14:461:27 | new[] | test.cpp:466:5:466:19 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:461:14:461:27 | new[] | new[] | test.cpp:466:8:466:14 | src_pos | src_pos |
1250-
| test.cpp:477:5:477:19 | Store: ... = ... | test.cpp:472:14:472:27 | new[] | test.cpp:477:5:477:19 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:472:14:472:27 | new[] | new[] | test.cpp:477:8:477:14 | src_pos | src_pos |
1251-
| test.cpp:488:5:488:19 | Store: ... = ... | test.cpp:483:14:483:27 | new[] | test.cpp:488:5:488:19 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:483:14:483:27 | new[] | new[] | test.cpp:488:8:488:14 | src_pos | src_pos |
12521227
| test.cpp:554:5:554:19 | Store: ... = ... | test.cpp:549:14:549:31 | new[] | test.cpp:554:5:554:19 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:549:14:549:31 | new[] | new[] | test.cpp:554:8:554:14 | src_pos | src_pos |

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ void test30(int *size)
416416
new_size = tmp_size + 1;
417417
char *xs = new char[new_size];
418418
for (int i = 0; i < new_size; i++) {
419-
xs[i] = 0; // GOOD [FALSE POSITIVE]
419+
xs[i] = 0; // GOOD
420420
}
421421
}
422422
*size = new_size;
@@ -430,7 +430,7 @@ void test31(unsigned size, unsigned src_pos)
430430
}
431431
unsigned dst_pos = src_pos;
432432
if(dst_pos < size - 3) {
433-
xs[dst_pos++] = 0; // GOOD [FALSE POSITIVE]
433+
xs[dst_pos++] = 0; // GOOD
434434
}
435435
}
436436

@@ -441,7 +441,7 @@ void test31_simple1(unsigned size, unsigned src_pos)
441441
src_pos = size;
442442
}
443443
if(src_pos < size) {
444-
xs[src_pos] = 0; // GOOD [FALSE POSITIVE]
444+
xs[src_pos] = 0; // GOOD
445445
}
446446
}
447447

@@ -474,7 +474,7 @@ void test31_simple4(unsigned size, unsigned src_pos)
474474
src_pos = size;
475475
}
476476
if(src_pos < size - 1) {
477-
xs[src_pos] = 0; // GOOD [FALSE POSITIVE]
477+
xs[src_pos] = 0; // GOOD
478478
}
479479
}
480480

@@ -485,7 +485,7 @@ void test31_simple5(unsigned size, unsigned src_pos)
485485
src_pos = size;
486486
}
487487
if(src_pos + 1 < size) {
488-
xs[src_pos] = 0; // GOOD [FALSE POSITIVE]
488+
xs[src_pos] = 0; // GOOD
489489
}
490490
}
491491

0 commit comments

Comments
 (0)