Skip to content

Commit b1dcb01

Browse files
authored
Merge pull request #11977 from MathiasVP/accept-test-changes
C++: Accept test changes on the use-use flow branch
2 parents 9f9c486 + ec297fb commit b1dcb01

File tree

6 files changed

+16
-60
lines changed

6 files changed

+16
-60
lines changed

cpp/ql/test/library-tests/syntax-zoo/dataflow-ir-consistency.expected

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ uniqueNodeLocation
7171
| file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. |
7272
| file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. |
7373
| file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. |
74-
| file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. |
75-
| file://:0:0:0:0 | (unnamed parameter 2) indirection | Node should have one location but has 0. |
7674
| file://:0:0:0:0 | (unnamed parameter 2) indirection | Node should have one location but has 0. |
7775
| file://:0:0:0:0 | (unnamed parameter 2) indirection | Node should have one location but has 0. |
7876
| file://:0:0:0:0 | (unnamed parameter 2) indirection | Node should have one location but has 0. |
@@ -155,7 +153,7 @@ uniqueNodeLocation
155153
| switchstmt.c:1:12:1:12 | x indirection | Node should have one location but has 4. |
156154
| switchstmt.c:1:12:1:12 | x indirection | Node should have one location but has 4. |
157155
missingLocation
158-
| Nodes without location: 37 |
156+
| Nodes without location: 35 |
159157
uniqueNodeToString
160158
| break_labels.c:2:11:2:11 | i | Node should have one toString but has 2. |
161159
| break_labels.c:2:11:2:11 | i | Node should have one toString but has 2. |

cpp/ql/test/query-tests/Security/CWE/CWE-119/semmle/tests/OverflowDestination.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ edges
2424
| overflowdestination.cpp:52:9:52:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
2525
| overflowdestination.cpp:53:9:53:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
2626
| overflowdestination.cpp:53:9:53:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
27+
| overflowdestination.cpp:54:9:54:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
28+
| overflowdestination.cpp:54:9:54:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
2729
| overflowdestination.cpp:57:40:57:43 | dest | overflowdestination.cpp:65:9:65:13 | memcpy output argument |
2830
| overflowdestination.cpp:57:40:57:43 | dest indirection | overflowdestination.cpp:65:9:65:13 | memcpy output argument |
2931
| overflowdestination.cpp:57:52:57:54 | src | overflowdestination.cpp:63:9:63:13 | memcpy output argument |

cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/argv/argvLocal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ int main(int argc, char **argv) {
169169
printf((char *) i10);
170170
printWrapper((char *) i10);
171171

172-
// BAD: b value comes from argv
172+
// BAD: b value comes from argv [NOT DETECTED]
173173
{
174174
char b[64];
175175
char *bp = &b[0];
@@ -184,7 +184,7 @@ int main(int argc, char **argv) {
184184
printWrapper(bp);
185185
}
186186

187-
// BAD: b value comes from argv
187+
// BAD: b value comes from argv [NOT DETECTED]
188188
{
189189
char b[64];
190190
char *bp = &b[0];

cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/argv/argvLocal.expected

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,6 @@ edges
147147
| argvLocal.c:168:18:168:21 | argv | argvLocal.c:170:24:170:26 | i10 |
148148
| argvLocal.c:168:18:168:21 | argv | argvLocal.c:170:24:170:26 | i10 |
149149
| argvLocal.c:168:18:168:21 | argv | argvLocal.c:170:24:170:26 | i10 |
150-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:183:10:183:11 | (const char *)... |
151-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:183:10:183:11 | (const char *)... |
152-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:183:10:183:11 | bp |
153-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:183:10:183:11 | bp |
154-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:183:10:183:11 | bp indirection |
155-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:183:10:183:11 | bp indirection |
156-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:184:16:184:17 | bp |
157-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:184:16:184:17 | bp |
158-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:184:16:184:17 | bp |
159-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:184:16:184:17 | bp |
160-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:184:16:184:17 | bp indirection |
161-
| argvLocal.c:182:13:182:16 | argv | argvLocal.c:184:16:184:17 | bp indirection |
162-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:198:10:198:11 | (const char *)... |
163-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:198:10:198:11 | (const char *)... |
164-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:198:10:198:11 | bp |
165-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:198:10:198:11 | bp |
166-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:198:10:198:11 | bp indirection |
167-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:198:10:198:11 | bp indirection |
168-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:199:16:199:17 | bp |
169-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:199:16:199:17 | bp |
170-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:199:16:199:17 | bp |
171-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:199:16:199:17 | bp |
172-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:199:16:199:17 | bp indirection |
173-
| argvLocal.c:197:13:197:16 | argv | argvLocal.c:199:16:199:17 | bp indirection |
174150
subpaths
175151
nodes
176152
| argvLocal.c:95:9:95:12 | argv | semmle.label | argv |
@@ -263,22 +239,6 @@ nodes
263239
| argvLocal.c:170:15:170:26 | i10 | semmle.label | i10 |
264240
| argvLocal.c:170:24:170:26 | i10 | semmle.label | i10 |
265241
| argvLocal.c:170:24:170:26 | i10 | semmle.label | i10 |
266-
| argvLocal.c:182:13:182:16 | argv | semmle.label | argv |
267-
| argvLocal.c:182:13:182:16 | argv | semmle.label | argv |
268-
| argvLocal.c:183:10:183:11 | (const char *)... | semmle.label | (const char *)... |
269-
| argvLocal.c:183:10:183:11 | bp | semmle.label | bp |
270-
| argvLocal.c:183:10:183:11 | bp indirection | semmle.label | bp indirection |
271-
| argvLocal.c:184:16:184:17 | bp | semmle.label | bp |
272-
| argvLocal.c:184:16:184:17 | bp | semmle.label | bp |
273-
| argvLocal.c:184:16:184:17 | bp indirection | semmle.label | bp indirection |
274-
| argvLocal.c:197:13:197:16 | argv | semmle.label | argv |
275-
| argvLocal.c:197:13:197:16 | argv | semmle.label | argv |
276-
| argvLocal.c:198:10:198:11 | (const char *)... | semmle.label | (const char *)... |
277-
| argvLocal.c:198:10:198:11 | bp | semmle.label | bp |
278-
| argvLocal.c:198:10:198:11 | bp indirection | semmle.label | bp indirection |
279-
| argvLocal.c:199:16:199:17 | bp | semmle.label | bp |
280-
| argvLocal.c:199:16:199:17 | bp | semmle.label | bp |
281-
| argvLocal.c:199:16:199:17 | bp indirection | semmle.label | bp indirection |
282242
#select
283243
| argvLocal.c:95:9:95:15 | access to array | argvLocal.c:95:9:95:12 | argv | argvLocal.c:95:9:95:15 | access to array | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | argvLocal.c:95:9:95:12 | argv | argv |
284244
| argvLocal.c:96:15:96:21 | access to array | argvLocal.c:96:15:96:18 | argv | argvLocal.c:96:15:96:21 | access to array | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format). | argvLocal.c:96:15:96:18 | argv | argv |
@@ -306,7 +266,3 @@ nodes
306266
| argvLocal.c:151:15:151:16 | i8 | argvLocal.c:149:11:149:14 | argv | argvLocal.c:151:15:151:16 | i8 | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format). | argvLocal.c:149:11:149:14 | argv | argv |
307267
| argvLocal.c:169:18:169:20 | i10 | argvLocal.c:168:18:168:21 | argv | argvLocal.c:169:18:169:20 | i10 | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | argvLocal.c:168:18:168:21 | argv | argv |
308268
| argvLocal.c:170:24:170:26 | i10 | argvLocal.c:168:18:168:21 | argv | argvLocal.c:170:24:170:26 | i10 | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format). | argvLocal.c:168:18:168:21 | argv | argv |
309-
| argvLocal.c:183:10:183:11 | bp | argvLocal.c:182:13:182:16 | argv | argvLocal.c:183:10:183:11 | bp | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | argvLocal.c:182:13:182:16 | argv | argv |
310-
| argvLocal.c:184:16:184:17 | bp | argvLocal.c:182:13:182:16 | argv | argvLocal.c:184:16:184:17 | bp | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format). | argvLocal.c:182:13:182:16 | argv | argv |
311-
| argvLocal.c:198:10:198:11 | bp | argvLocal.c:197:13:197:16 | argv | argvLocal.c:198:10:198:11 | bp | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | argvLocal.c:197:13:197:16 | argv | argv |
312-
| argvLocal.c:199:16:199:17 | bp | argvLocal.c:197:13:197:16 | argv | argvLocal.c:199:16:199:17 | bp | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format). | argvLocal.c:197:13:197:16 | argv | argv |

cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/ArithmeticUncontrolled/ArithmeticUncontrolled.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ edges
1313
| test.c:155:22:155:27 | call to rand | test.c:157:9:157:9 | r |
1414
| test.cpp:6:5:6:12 | get_rand indirection | test.cpp:25:7:25:7 | r |
1515
| test.cpp:8:9:8:12 | call to rand | test.cpp:6:5:6:12 | get_rand indirection |
16-
| test.cpp:11:21:11:24 | dest indirection | test.cpp:30:13:30:14 | get_rand2 output argument |
17-
| test.cpp:13:10:13:13 | call to rand | test.cpp:11:21:11:24 | dest indirection |
18-
| test.cpp:16:21:16:24 | dest indirection | test.cpp:36:13:36:13 | get_rand3 output argument |
19-
| test.cpp:18:9:18:12 | call to rand | test.cpp:16:21:16:24 | dest indirection |
16+
| test.cpp:11:21:11:24 | dest | test.cpp:30:13:30:14 | get_rand2 output argument |
17+
| test.cpp:13:10:13:13 | call to rand | test.cpp:11:21:11:24 | dest |
18+
| test.cpp:16:21:16:24 | dest | test.cpp:36:13:36:13 | get_rand3 output argument |
19+
| test.cpp:18:9:18:12 | call to rand | test.cpp:16:21:16:24 | dest |
2020
| test.cpp:30:13:30:14 | get_rand2 output argument | test.cpp:31:7:31:7 | r |
2121
| test.cpp:36:13:36:13 | get_rand3 output argument | test.cpp:37:7:37:7 | r |
2222
| test.cpp:86:10:86:13 | call to rand | test.cpp:90:10:90:10 | x |
@@ -56,9 +56,9 @@ nodes
5656
| test.c:157:9:157:9 | r | semmle.label | r |
5757
| test.cpp:6:5:6:12 | get_rand indirection | semmle.label | get_rand indirection |
5858
| test.cpp:8:9:8:12 | call to rand | semmle.label | call to rand |
59-
| test.cpp:11:21:11:24 | dest indirection | semmle.label | dest indirection |
59+
| test.cpp:11:21:11:24 | dest | semmle.label | dest |
6060
| test.cpp:13:10:13:13 | call to rand | semmle.label | call to rand |
61-
| test.cpp:16:21:16:24 | dest indirection | semmle.label | dest indirection |
61+
| test.cpp:16:21:16:24 | dest | semmle.label | dest |
6262
| test.cpp:18:9:18:12 | call to rand | semmle.label | call to rand |
6363
| test.cpp:25:7:25:7 | r | semmle.label | r |
6464
| test.cpp:30:13:30:14 | get_rand2 output argument | semmle.label | get_rand2 output argument |

cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/TaintedAllocationSize/TaintedAllocationSize.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ edges
3434
| test.cpp:237:24:237:37 | call to getenv indirection | test.cpp:245:11:245:20 | local_size |
3535
| test.cpp:237:24:237:37 | call to getenv indirection | test.cpp:247:10:247:19 | local_size |
3636
| test.cpp:247:10:247:19 | local_size | test.cpp:230:21:230:21 | s |
37-
| test.cpp:250:20:250:27 | out_size indirection | test.cpp:289:17:289:20 | get_size output argument |
38-
| test.cpp:250:20:250:27 | out_size indirection | test.cpp:305:18:305:21 | get_size output argument |
39-
| test.cpp:251:18:251:23 | call to getenv | test.cpp:250:20:250:27 | out_size indirection |
40-
| test.cpp:251:18:251:31 | call to getenv indirection | test.cpp:250:20:250:27 | out_size indirection |
37+
| test.cpp:250:20:250:27 | out_size | test.cpp:289:17:289:20 | get_size output argument |
38+
| test.cpp:250:20:250:27 | out_size | test.cpp:305:18:305:21 | get_size output argument |
39+
| test.cpp:251:18:251:23 | call to getenv | test.cpp:250:20:250:27 | out_size |
40+
| test.cpp:251:18:251:31 | call to getenv indirection | test.cpp:250:20:250:27 | out_size |
4141
| test.cpp:259:20:259:25 | call to getenv | test.cpp:263:11:263:29 | ... * ... |
4242
| test.cpp:259:20:259:33 | call to getenv indirection | test.cpp:263:11:263:29 | ... * ... |
4343
| test.cpp:289:17:289:20 | get_size output argument | test.cpp:291:11:291:28 | ... * ... |
@@ -76,7 +76,7 @@ nodes
7676
| test.cpp:241:9:241:24 | call to get_tainted_size | semmle.label | call to get_tainted_size |
7777
| test.cpp:245:11:245:20 | local_size | semmle.label | local_size |
7878
| test.cpp:247:10:247:19 | local_size | semmle.label | local_size |
79-
| test.cpp:250:20:250:27 | out_size indirection | semmle.label | out_size indirection |
79+
| test.cpp:250:20:250:27 | out_size | semmle.label | out_size |
8080
| test.cpp:251:18:251:23 | call to getenv | semmle.label | call to getenv |
8181
| test.cpp:251:18:251:31 | call to getenv indirection | semmle.label | call to getenv indirection |
8282
| test.cpp:259:20:259:25 | call to getenv | semmle.label | call to getenv |

0 commit comments

Comments
 (0)