Skip to content

Commit f6f5f5d

Browse files
committed
C++: Accept test changes.
1 parent c9bd9e9 commit f6f5f5d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-129/semmle/ImproperArrayIndexValidation/ImproperArrayIndexValidation.expected

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,36 @@ edges
22
| test1.c:7:26:7:29 | **argv | test1.c:8:11:8:14 | call to atoi | provenance | TaintFunction |
33
| test1.c:8:11:8:14 | call to atoi | test1.c:9:9:9:9 | i | provenance | |
44
| test1.c:8:11:8:14 | call to atoi | test1.c:11:9:11:9 | i | provenance | |
5+
| test1.c:8:11:8:14 | call to atoi | test1.c:12:9:12:9 | i | provenance | |
56
| test1.c:8:11:8:14 | call to atoi | test1.c:13:9:13:9 | i | provenance | |
67
| test1.c:9:9:9:9 | i | test1.c:16:16:16:16 | i | provenance | |
78
| test1.c:11:9:11:9 | i | test1.c:32:16:32:16 | i | provenance | |
9+
| test1.c:12:9:12:9 | i | test1.c:40:16:40:16 | i | provenance | |
810
| test1.c:13:9:13:9 | i | test1.c:48:16:48:16 | i | provenance | |
911
| test1.c:16:16:16:16 | i | test1.c:18:16:18:16 | i | provenance | |
1012
| test1.c:32:16:32:16 | i | test1.c:33:11:33:11 | i | provenance | |
13+
| test1.c:40:16:40:16 | i | test1.c:41:11:41:11 | i | provenance | |
1114
| test1.c:48:16:48:16 | i | test1.c:51:3:51:7 | ... = ... | provenance | |
1215
| test1.c:51:3:51:7 | ... = ... | test1.c:53:15:53:15 | j | provenance | |
1316
nodes
1417
| test1.c:7:26:7:29 | **argv | semmle.label | **argv |
1518
| test1.c:8:11:8:14 | call to atoi | semmle.label | call to atoi |
1619
| test1.c:9:9:9:9 | i | semmle.label | i |
1720
| test1.c:11:9:11:9 | i | semmle.label | i |
21+
| test1.c:12:9:12:9 | i | semmle.label | i |
1822
| test1.c:13:9:13:9 | i | semmle.label | i |
1923
| test1.c:16:16:16:16 | i | semmle.label | i |
2024
| test1.c:18:16:18:16 | i | semmle.label | i |
2125
| test1.c:32:16:32:16 | i | semmle.label | i |
2226
| test1.c:33:11:33:11 | i | semmle.label | i |
27+
| test1.c:40:16:40:16 | i | semmle.label | i |
28+
| test1.c:41:11:41:11 | i | semmle.label | i |
2329
| test1.c:48:16:48:16 | i | semmle.label | i |
2430
| test1.c:51:3:51:7 | ... = ... | semmle.label | ... = ... |
2531
| test1.c:53:15:53:15 | j | semmle.label | j |
2632
subpaths
2733
#select
2834
| test1.c:18:16:18:16 | i | test1.c:7:26:7:29 | **argv | test1.c:18:16:18:16 | i | An array indexing expression depends on $@ that might be outside the bounds of the array. | test1.c:7:26:7:29 | **argv | a command-line argument |
2935
| test1.c:33:11:33:11 | i | test1.c:7:26:7:29 | **argv | test1.c:33:11:33:11 | i | An array indexing expression depends on $@ that might be outside the bounds of the array. | test1.c:7:26:7:29 | **argv | a command-line argument |
36+
| test1.c:41:11:41:11 | i | test1.c:7:26:7:29 | **argv | test1.c:41:11:41:11 | i | An array indexing expression depends on $@ that might be outside the bounds of the array. | test1.c:7:26:7:29 | **argv | a command-line argument |
3037
| test1.c:53:15:53:15 | j | test1.c:7:26:7:29 | **argv | test1.c:53:15:53:15 | j | An array indexing expression depends on $@ that might be outside the bounds of the array. | test1.c:7:26:7:29 | **argv | a command-line argument |

cpp/ql/test/query-tests/Security/CWE/CWE-129/semmle/ImproperArrayIndexValidation/test1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void test3(int i) {
3838
}
3939

4040
void test4(int i) {
41-
myArray[i] = 0; // BAD: i has not been validated [NOT REPORTED]
41+
myArray[i] = 0; // BAD: i has not been validated
4242

4343
if ((i < 0) || (i >= 10)) return;
4444

0 commit comments

Comments
 (0)