Skip to content

Commit fd19490

Browse files
committed
C++: Accept test changes.
1 parent ce9a14b commit fd19490

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ edges
223223
| test.cpp:667:14:667:31 | new[] | test.cpp:675:7:675:23 | ... = ... |
224224
| test.cpp:695:13:695:26 | new[] | test.cpp:698:5:698:10 | ... += ... |
225225
| test.cpp:698:5:698:10 | ... += ... | test.cpp:701:15:701:16 | * ... |
226+
| test.cpp:705:18:705:18 | q | test.cpp:705:18:705:18 | q |
227+
| test.cpp:705:18:705:18 | q | test.cpp:706:12:706:13 | * ... |
228+
| test.cpp:705:18:705:18 | q | test.cpp:706:12:706:13 | * ... |
229+
| test.cpp:711:13:711:26 | new[] | test.cpp:714:11:714:11 | q |
230+
| test.cpp:714:11:714:11 | q | test.cpp:705:18:705:18 | q |
226231
nodes
227232
| test.cpp:4:15:4:20 | call to malloc | semmle.label | call to malloc |
228233
| test.cpp:5:15:5:22 | ... + ... | semmle.label | ... + ... |
@@ -375,6 +380,11 @@ nodes
375380
| test.cpp:695:13:695:26 | new[] | semmle.label | new[] |
376381
| test.cpp:698:5:698:10 | ... += ... | semmle.label | ... += ... |
377382
| test.cpp:701:15:701:16 | * ... | semmle.label | * ... |
383+
| test.cpp:705:18:705:18 | q | semmle.label | q |
384+
| test.cpp:705:18:705:18 | q | semmle.label | q |
385+
| test.cpp:706:12:706:13 | * ... | semmle.label | * ... |
386+
| test.cpp:711:13:711:26 | new[] | semmle.label | new[] |
387+
| test.cpp:714:11:714:11 | q | semmle.label | q |
378388
subpaths
379389
#select
380390
| test.cpp:6:14:6:15 | * ... | test.cpp:4:15:4:20 | call to malloc | test.cpp:6:14:6:15 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:4:15:4:20 | call to malloc | call to malloc | test.cpp:5:19:5:22 | size | size |
@@ -411,3 +421,4 @@ subpaths
411421
| test.cpp:662:3:662:11 | ... = ... | test.cpp:652:14:652:27 | new[] | test.cpp:662:3:662:11 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@ + 1. | test.cpp:652:14:652:27 | new[] | new[] | test.cpp:653:19:653:22 | size | size |
412422
| 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 | ... ++ | ... ++ |
413423
| 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 |
424+
| 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ void test34(unsigned size) {
703703
}
704704

705705
void deref(char* q) {
706-
char x = *q; // $ MISSING: deref=L712->L706 deref=L713->L706
706+
char x = *q; // $ deref=L714->L705->L706 // BAD
707707
}
708708

709709
void test35(unsigned long size, char* q)

0 commit comments

Comments
 (0)