Skip to content

Commit 6f5ac8d

Browse files
committed
C++: Accept test changes.
1 parent ed95b03 commit 6f5ac8d

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ edges
3636
| test.cpp:143:18:143:21 | asdf | test.cpp:134:25:134:27 | arr |
3737
| test.cpp:143:18:143:21 | asdf | test.cpp:143:18:143:21 | asdf |
3838
| test.cpp:146:26:146:26 | p indirection | test.cpp:147:4:147:9 | -- ... |
39-
| test.cpp:146:26:146:26 | p indirection | test.cpp:148:6:148:9 | * ... |
4039
| test.cpp:156:12:156:14 | buf | test.cpp:156:12:156:18 | ... + ... |
4140
| test.cpp:156:12:156:18 | ... + ... | test.cpp:158:17:158:18 | & ... indirection |
4241
| test.cpp:158:17:158:18 | & ... indirection | test.cpp:146:26:146:26 | p indirection |
@@ -124,7 +123,6 @@ nodes
124123
| test.cpp:143:18:143:21 | asdf | semmle.label | asdf |
125124
| test.cpp:146:26:146:26 | p indirection | semmle.label | p indirection |
126125
| test.cpp:147:4:147:9 | -- ... | semmle.label | -- ... |
127-
| test.cpp:148:6:148:9 | * ... | semmle.label | * ... |
128126
| test.cpp:156:12:156:14 | buf | semmle.label | buf |
129127
| test.cpp:156:12:156:18 | ... + ... | semmle.label | ... + ... |
130128
| test.cpp:158:17:158:18 | & ... indirection | semmle.label | & ... indirection |
@@ -178,7 +176,6 @@ subpaths
178176
| test.cpp:128:9:128:14 | PointerAdd: access to array | test.cpp:128:9:128:11 | arr | test.cpp:128:9:128:14 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:125:11:125:13 | arr | arr | test.cpp:128:9:128:18 | Store: ... = ... | write |
179177
| test.cpp:136:9:136:16 | PointerAdd: ... += ... | test.cpp:143:18:143:21 | asdf | test.cpp:138:13:138:15 | arr | This pointer arithmetic may have an off-by-2 error allowing it to overrun $@ at this $@. | test.cpp:142:10:142:13 | asdf | asdf | test.cpp:138:12:138:15 | Load: * ... | read |
180178
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:147:4:147:9 | -- ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:147:3:147:13 | Store: ... = ... | write |
181-
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:148:6:148:9 | * ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:147:3:147:13 | Store: ... = ... | write |
182179
| test.cpp:221:5:221:11 | PointerAdd: access to array | test.cpp:218:23:218:28 | buffer | test.cpp:221:5:221:11 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:217:19:217:24 | buffer | buffer | test.cpp:221:5:221:15 | Store: ... = ... | write |
183180
| test.cpp:232:5:232:10 | PointerAdd: access to array | test.cpp:229:25:229:29 | array | test.cpp:232:5:232:10 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:228:10:228:14 | array | array | test.cpp:232:5:232:19 | Store: ... = ... | write |
184181
| test.cpp:261:27:261:30 | PointerAdd: access to array | test.cpp:286:19:286:25 | buffer2 | test.cpp:261:27:261:30 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:285:19:285:25 | buffer2 | buffer2 | test.cpp:261:27:261:30 | Load: access to array | read |

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ edges
7777
| test.cpp:271:14:271:21 | ... + ... | test.cpp:271:14:271:21 | ... + ... |
7878
| test.cpp:271:14:271:21 | ... + ... | test.cpp:274:5:274:10 | ... = ... |
7979
| test.cpp:271:14:271:21 | ... + ... | test.cpp:274:5:274:10 | ... = ... |
80+
| test.cpp:313:14:313:27 | new[] | test.cpp:314:15:314:23 | ... + ... |
81+
| test.cpp:313:14:313:27 | new[] | test.cpp:314:15:314:23 | ... + ... |
82+
| test.cpp:313:14:313:27 | new[] | test.cpp:319:5:319:21 | ... = ... |
83+
| test.cpp:314:15:314:23 | ... + ... | test.cpp:314:15:314:23 | ... + ... |
84+
| test.cpp:314:15:314:23 | ... + ... | test.cpp:319:5:319:21 | ... = ... |
85+
| test.cpp:325:14:325:27 | new[] | test.cpp:326:15:326:23 | ... + ... |
86+
| test.cpp:325:14:325:27 | new[] | test.cpp:326:15:326:23 | ... + ... |
87+
| test.cpp:325:14:325:27 | new[] | test.cpp:333:5:333:21 | ... = ... |
88+
| test.cpp:325:14:325:27 | new[] | test.cpp:341:5:341:21 | ... = ... |
89+
| test.cpp:325:14:325:27 | new[] | test.cpp:342:5:342:21 | ... = ... |
90+
| test.cpp:326:15:326:23 | ... + ... | test.cpp:326:15:326:23 | ... + ... |
91+
| test.cpp:326:15:326:23 | ... + ... | test.cpp:333:5:333:21 | ... = ... |
92+
| test.cpp:326:15:326:23 | ... + ... | test.cpp:341:5:341:21 | ... = ... |
93+
| test.cpp:326:15:326:23 | ... + ... | test.cpp:342:5:342:21 | ... = ... |
8094
| test.cpp:355:14:355:27 | new[] | test.cpp:356:15:356:23 | ... + ... |
8195
| test.cpp:355:14:355:27 | new[] | test.cpp:356:15:356:23 | ... + ... |
8296
| test.cpp:355:14:355:27 | new[] | test.cpp:357:24:357:30 | ... + ... |
@@ -243,6 +257,16 @@ nodes
243257
| test.cpp:271:14:271:21 | ... + ... | semmle.label | ... + ... |
244258
| test.cpp:271:14:271:21 | ... + ... | semmle.label | ... + ... |
245259
| test.cpp:274:5:274:10 | ... = ... | semmle.label | ... = ... |
260+
| test.cpp:313:14:313:27 | new[] | semmle.label | new[] |
261+
| test.cpp:314:15:314:23 | ... + ... | semmle.label | ... + ... |
262+
| test.cpp:314:15:314:23 | ... + ... | semmle.label | ... + ... |
263+
| test.cpp:319:5:319:21 | ... = ... | semmle.label | ... = ... |
264+
| test.cpp:325:14:325:27 | new[] | semmle.label | new[] |
265+
| test.cpp:326:15:326:23 | ... + ... | semmle.label | ... + ... |
266+
| test.cpp:326:15:326:23 | ... + ... | semmle.label | ... + ... |
267+
| test.cpp:333:5:333:21 | ... = ... | semmle.label | ... = ... |
268+
| test.cpp:341:5:341:21 | ... = ... | semmle.label | ... = ... |
269+
| test.cpp:342:5:342:21 | ... = ... | semmle.label | ... = ... |
246270
| test.cpp:355:14:355:27 | new[] | semmle.label | new[] |
247271
| test.cpp:356:15:356:23 | ... + ... | semmle.label | ... + ... |
248272
| test.cpp:356:15:356:23 | ... + ... | semmle.label | ... + ... |
@@ -340,6 +364,10 @@ subpaths
340364
| test.cpp:254:9:254:16 | ... = ... | test.cpp:248:24:248:30 | call to realloc | test.cpp:254:9:254:16 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:248:24:248:30 | call to realloc | call to realloc | test.cpp:254:11:254:11 | i | i |
341365
| test.cpp:264:13:264:14 | * ... | test.cpp:260:13:260:24 | new[] | test.cpp:264:13:264:14 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:260:13:260:24 | new[] | new[] | test.cpp:261:19:261:21 | len | len |
342366
| test.cpp:274:5:274:10 | ... = ... | test.cpp:270:13:270:24 | new[] | test.cpp:274:5:274:10 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:270:13:270:24 | new[] | new[] | test.cpp:271:19:271:21 | len | len |
367+
| test.cpp:319:5:319:21 | ... = ... | test.cpp:313:14:313:27 | new[] | test.cpp:319:5:319:21 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:313:14:313:27 | new[] | new[] | test.cpp:314:20:314:23 | size | size |
368+
| test.cpp:333:5:333:21 | ... = ... | test.cpp:325:14:325:27 | new[] | test.cpp:333:5:333:21 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:325:14:325:27 | new[] | new[] | test.cpp:326:20:326:23 | size | size |
369+
| test.cpp:341:5:341:21 | ... = ... | test.cpp:325:14:325:27 | new[] | test.cpp:341:5:341:21 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:325:14:325:27 | new[] | new[] | test.cpp:326:20:326:23 | size | size |
370+
| test.cpp:342:5:342:21 | ... = ... | test.cpp:325:14:325:27 | new[] | test.cpp:342:5:342:21 | ... = ... | This write might be out of bounds, as the pointer might be equal to $@ + $@. | test.cpp:325:14:325:27 | new[] | new[] | test.cpp:326:20:326:23 | size | size |
343371
| test.cpp:358:14:358:26 | * ... | test.cpp:355:14:355:27 | new[] | test.cpp:358:14:358:26 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@ + 1. | test.cpp:355:14:355:27 | new[] | new[] | test.cpp:356:20:356:23 | size | size |
344372
| test.cpp:359:14:359:32 | * ... | test.cpp:355:14:355:27 | new[] | test.cpp:359:14:359:32 | * ... | This read might be out of bounds, as the pointer might be equal to $@ + $@ + 2. | test.cpp:355:14:355:27 | new[] | new[] | test.cpp:356:20:356:23 | size | size |
345373
| test.cpp:384:13:384:16 | * ... | test.cpp:377:14:377:27 | new[] | test.cpp:384:13:384:16 | * ... | 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 |

0 commit comments

Comments
 (0)