Skip to content

Commit 49a5a39

Browse files
committed
C++: Accept test changes.
1 parent e145b81 commit 49a5a39

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/constant-size/ConstantSizeArrayOffByOne.expected

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ edges
6969
| test.cpp:322:19:322:27 | ... + ... | test.cpp:325:24:325:26 | end |
7070
| test.cpp:324:23:324:26 | temp | test.cpp:324:23:324:32 | ... + ... |
7171
| test.cpp:324:23:324:32 | ... + ... | test.cpp:325:15:325:19 | temp2 |
72-
| test.cpp:351:9:351:11 | arr | test.cpp:351:9:351:14 | access to array |
73-
| test.cpp:351:9:351:11 | arr | test.cpp:351:18:351:25 | access to array |
74-
| test.cpp:351:18:351:20 | arr | test.cpp:351:9:351:14 | access to array |
75-
| test.cpp:351:18:351:20 | arr | test.cpp:351:18:351:25 | access to array |
76-
| test.cpp:351:29:351:31 | arr | test.cpp:351:9:351:14 | access to array |
77-
| test.cpp:351:29:351:31 | arr | test.cpp:351:18:351:25 | access to array |
7872
nodes
7973
| test.cpp:34:5:34:24 | access to array | semmle.label | access to array |
8074
| test.cpp:34:10:34:12 | buf | semmle.label | buf |
@@ -167,11 +161,6 @@ nodes
167161
| test.cpp:325:15:325:19 | temp2 | semmle.label | temp2 |
168162
| test.cpp:325:24:325:26 | end | semmle.label | end |
169163
| test.cpp:325:24:325:26 | end | semmle.label | end |
170-
| test.cpp:351:9:351:11 | arr | semmle.label | arr |
171-
| test.cpp:351:9:351:14 | access to array | semmle.label | access to array |
172-
| test.cpp:351:18:351:20 | arr | semmle.label | arr |
173-
| test.cpp:351:18:351:25 | access to array | semmle.label | access to array |
174-
| test.cpp:351:29:351:31 | arr | semmle.label | arr |
175164
subpaths
176165
#select
177166
| test.cpp:35:5:35:22 | PointerAdd: access to array | test.cpp:35:10:35:12 | buf | test.cpp:35:5:35:22 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:15:9:15:11 | buf | buf | test.cpp:35:5:35:26 | Store: ... = ... | write |
@@ -194,6 +183,3 @@ subpaths
194183
| test.cpp:322:19:322:27 | PointerAdd: ... + ... | test.cpp:322:19:322:22 | temp | test.cpp:325:24:325:26 | end | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:314:10:314:13 | temp | temp | test.cpp:330:13:330:24 | Store: ... = ... | write |
195184
| test.cpp:322:19:322:27 | PointerAdd: ... + ... | test.cpp:322:19:322:22 | temp | test.cpp:325:24:325:26 | end | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:314:10:314:13 | temp | temp | test.cpp:331:13:331:24 | Store: ... = ... | write |
196185
| test.cpp:322:19:322:27 | PointerAdd: ... + ... | test.cpp:322:19:322:22 | temp | test.cpp:325:24:325:26 | end | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:314:10:314:13 | temp | temp | test.cpp:333:13:333:24 | Store: ... = ... | write |
197-
| test.cpp:351:18:351:25 | PointerAdd: access to array | test.cpp:351:9:351:11 | arr | test.cpp:351:18:351:25 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:348:9:348:11 | arr | arr | test.cpp:351:18:351:25 | Load: access to array | read |
198-
| test.cpp:351:18:351:25 | PointerAdd: access to array | test.cpp:351:18:351:20 | arr | test.cpp:351:18:351:25 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:348:9:348:11 | arr | arr | test.cpp:351:18:351:25 | Load: access to array | read |
199-
| test.cpp:351:18:351:25 | PointerAdd: access to array | test.cpp:351:29:351:31 | arr | test.cpp:351:18:351:25 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:348:9:348:11 | arr | arr | test.cpp:351:18:351:25 | Load: access to array | read |

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/constant-size/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ int positiveRange(int x) {
348348
int arr[128];
349349

350350
for(int i=127-offset; i>= 0; i--) {
351-
arr[i] = arr[i+1] + arr[i+offset]; // GOOD [FALSE POSITIVE]
351+
arr[i] = arr[i+1] + arr[i+offset]; // GOOD
352352
}
353353
return arr[0];
354354
}

0 commit comments

Comments
 (0)