Skip to content

Commit 494afdd

Browse files
committed
C++: Accept test changes.
1 parent ac03242 commit 494afdd

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,34 @@ edges
612612
| test.cpp:194:23:194:28 | call to malloc | test.cpp:195:17:195:17 | Load |
613613
| test.cpp:194:23:194:28 | call to malloc | test.cpp:197:8:197:8 | Load |
614614
| test.cpp:194:23:194:28 | call to malloc | test.cpp:201:5:201:5 | Load |
615+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | ... + ... |
616+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | ... + ... |
617+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | ... + ... |
618+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | ... + ... |
619+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | Store |
620+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | Store |
621+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | Store |
622+
| test.cpp:195:17:195:17 | Load | test.cpp:195:17:195:23 | Store |
623+
| test.cpp:195:17:195:17 | Load | test.cpp:197:20:197:22 | Load |
624+
| test.cpp:195:17:195:17 | Load | test.cpp:197:20:197:22 | Load |
625+
| test.cpp:195:17:195:17 | Load | test.cpp:197:20:197:22 | Load |
626+
| test.cpp:195:17:195:17 | Load | test.cpp:197:20:197:22 | Load |
627+
| test.cpp:195:17:195:17 | Load | test.cpp:201:5:201:12 | access to array |
628+
| test.cpp:195:17:195:17 | Load | test.cpp:201:5:201:12 | access to array |
629+
| test.cpp:195:17:195:17 | Load | test.cpp:201:5:201:12 | access to array |
630+
| test.cpp:195:17:195:17 | Load | test.cpp:201:5:201:12 | access to array |
631+
| test.cpp:195:17:195:23 | ... + ... | test.cpp:195:17:195:23 | Store |
632+
| test.cpp:195:17:195:23 | ... + ... | test.cpp:195:17:195:23 | Store |
633+
| test.cpp:195:17:195:23 | ... + ... | test.cpp:197:20:197:22 | Load |
634+
| test.cpp:195:17:195:23 | ... + ... | test.cpp:201:5:201:19 | Store: ... = ... |
635+
| test.cpp:195:17:195:23 | ... + ... | test.cpp:201:5:201:19 | Store: ... = ... |
636+
| test.cpp:195:17:195:23 | Store | test.cpp:197:20:197:22 | Load |
637+
| test.cpp:195:17:195:23 | Store | test.cpp:201:5:201:19 | Store: ... = ... |
638+
| test.cpp:195:17:195:23 | Store | test.cpp:201:5:201:19 | Store: ... = ... |
639+
| test.cpp:197:20:197:22 | Load | test.cpp:201:5:201:19 | Store: ... = ... |
640+
| test.cpp:197:20:197:22 | Load | test.cpp:201:5:201:19 | Store: ... = ... |
641+
| test.cpp:201:5:201:12 | access to array | test.cpp:201:5:201:19 | Store: ... = ... |
642+
| test.cpp:201:5:201:12 | access to array | test.cpp:201:5:201:19 | Store: ... = ... |
615643
| test.cpp:205:23:205:28 | call to malloc | test.cpp:206:17:206:17 | Load |
616644
| test.cpp:205:23:205:28 | call to malloc | test.cpp:208:15:208:15 | Load |
617645
| test.cpp:206:17:206:17 | Load | test.cpp:206:17:206:23 | ... + ... |
@@ -665,4 +693,5 @@ edges
665693
| test.cpp:110:9:110:14 | Store: ... = ... | test.cpp:82:17:82:22 | call to malloc | test.cpp:110:9:110:14 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:82:17:82:22 | call to malloc | call to malloc | test.cpp:83:27:83:30 | size | size |
666694
| test.cpp:157:9:157:14 | Store: ... = ... | test.cpp:143:18:143:23 | call to malloc | test.cpp:157:9:157:14 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:143:18:143:23 | call to malloc | call to malloc | test.cpp:144:29:144:32 | size | size |
667695
| test.cpp:171:9:171:14 | Store: ... = ... | test.cpp:143:18:143:23 | call to malloc | test.cpp:171:9:171:14 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:143:18:143:23 | call to malloc | call to malloc | test.cpp:144:29:144:32 | size | size |
696+
| test.cpp:201:5:201:19 | Store: ... = ... | test.cpp:194:23:194:28 | call to malloc | test.cpp:201:5:201:19 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:194:23:194:28 | call to malloc | call to malloc | test.cpp:195:21:195:23 | len | len |
668697
| test.cpp:213:5:213:13 | Store: ... = ... | test.cpp:205:23:205:28 | call to malloc | test.cpp:213:5:213:13 | Store: ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:205:23:205:28 | call to malloc | call to malloc | test.cpp:206:21:206:23 | len | len |

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
@@ -198,7 +198,7 @@ void test12(unsigned len, unsigned index) {
198198
return;
199199
}
200200

201-
p[index] = '\0'; // BAD [NOT DETECTED]
201+
p[index] = '\0'; // BAD
202202
}
203203

204204
void test13(unsigned len, unsigned index) {

0 commit comments

Comments
 (0)