Skip to content

Commit ef9d342

Browse files
committed
C++: Accept more test changes.
1 parent c46f9e4 commit ef9d342

File tree

2 files changed

+15
-59
lines changed

2 files changed

+15
-59
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/array-access/ArrayAccessProductFlow.expected

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,35 @@ edges
99
| test.cpp:22:5:22:7 | arr indirection [p] | test.cpp:19:9:19:16 | mk_array indirection [p] |
1010
| test.cpp:28:19:28:26 | call to mk_array [p] | test.cpp:31:9:31:11 | arr indirection [p] |
1111
| test.cpp:28:19:28:26 | call to mk_array [p] | test.cpp:35:9:35:11 | arr indirection [p] |
12-
| test.cpp:31:9:31:11 | arr indirection [p] | test.cpp:31:13:31:13 | p indirection |
13-
| test.cpp:31:13:31:13 | p indirection | test.cpp:31:13:31:13 | p |
14-
| test.cpp:35:9:35:11 | arr indirection [p] | test.cpp:35:13:35:13 | p indirection |
15-
| test.cpp:35:13:35:13 | p indirection | test.cpp:35:13:35:13 | p |
12+
| test.cpp:31:9:31:11 | arr indirection [p] | test.cpp:31:13:31:13 | p |
13+
| test.cpp:35:9:35:11 | arr indirection [p] | test.cpp:35:13:35:13 | p |
1614
| test.cpp:39:27:39:29 | arr [p] | test.cpp:41:9:41:11 | arr indirection [p] |
1715
| test.cpp:39:27:39:29 | arr [p] | test.cpp:45:9:45:11 | arr indirection [p] |
18-
| test.cpp:41:9:41:11 | arr indirection [p] | test.cpp:41:13:41:13 | p indirection |
19-
| test.cpp:41:13:41:13 | p indirection | test.cpp:41:13:41:13 | p |
20-
| test.cpp:45:9:45:11 | arr indirection [p] | test.cpp:45:13:45:13 | p indirection |
21-
| test.cpp:45:13:45:13 | p indirection | test.cpp:45:13:45:13 | p |
16+
| test.cpp:41:9:41:11 | arr indirection [p] | test.cpp:41:13:41:13 | p |
17+
| test.cpp:45:9:45:11 | arr indirection [p] | test.cpp:45:13:45:13 | p |
2218
| test.cpp:50:18:50:25 | call to mk_array [p] | test.cpp:39:27:39:29 | arr [p] |
2319
| test.cpp:55:5:55:24 | ... = ... | test.cpp:55:9:55:9 | arr indirection [post update] [p] |
2420
| test.cpp:55:9:55:9 | arr indirection [post update] [p] | test.cpp:56:5:56:7 | arr indirection [p] |
2521
| test.cpp:55:13:55:18 | call to malloc | test.cpp:55:5:55:24 | ... = ... |
2622
| test.cpp:56:5:56:7 | arr indirection [p] | test.cpp:59:9:59:11 | arr indirection [p] |
2723
| test.cpp:56:5:56:7 | arr indirection [p] | test.cpp:63:9:63:11 | arr indirection [p] |
28-
| test.cpp:59:9:59:11 | arr indirection [p] | test.cpp:59:13:59:13 | p indirection |
29-
| test.cpp:59:13:59:13 | p indirection | test.cpp:59:13:59:13 | p |
30-
| test.cpp:63:9:63:11 | arr indirection [p] | test.cpp:63:13:63:13 | p indirection |
31-
| test.cpp:63:13:63:13 | p indirection | test.cpp:63:13:63:13 | p |
24+
| test.cpp:59:9:59:11 | arr indirection [p] | test.cpp:59:13:59:13 | p |
25+
| test.cpp:63:9:63:11 | arr indirection [p] | test.cpp:63:13:63:13 | p |
3226
| test.cpp:67:10:67:19 | mk_array_p indirection [p] | test.cpp:76:20:76:29 | call to mk_array_p indirection [p] |
3327
| test.cpp:67:10:67:19 | mk_array_p indirection [p] | test.cpp:98:18:98:27 | call to mk_array_p indirection [p] |
3428
| test.cpp:69:5:69:25 | ... = ... | test.cpp:69:10:69:10 | arr indirection [post update] [p] |
3529
| test.cpp:69:10:69:10 | arr indirection [post update] [p] | test.cpp:70:5:70:7 | arr indirection [p] |
3630
| test.cpp:69:14:69:19 | call to malloc | test.cpp:69:5:69:25 | ... = ... |
3731
| test.cpp:70:5:70:7 | arr indirection [p] | test.cpp:67:10:67:19 | mk_array_p indirection [p] |
32+
| test.cpp:70:5:70:7 | arr indirection [p] | test.cpp:70:5:70:7 | arr indirection [p] |
3833
| test.cpp:76:20:76:29 | call to mk_array_p indirection [p] | test.cpp:79:9:79:11 | arr indirection [p] |
3934
| test.cpp:76:20:76:29 | call to mk_array_p indirection [p] | test.cpp:83:9:83:11 | arr indirection [p] |
40-
| test.cpp:79:9:79:11 | arr indirection [p] | test.cpp:79:14:79:14 | p indirection |
41-
| test.cpp:79:14:79:14 | p indirection | test.cpp:79:14:79:14 | p |
42-
| test.cpp:83:9:83:11 | arr indirection [p] | test.cpp:83:14:83:14 | p indirection |
43-
| test.cpp:83:14:83:14 | p indirection | test.cpp:83:14:83:14 | p |
35+
| test.cpp:79:9:79:11 | arr indirection [p] | test.cpp:79:14:79:14 | p |
36+
| test.cpp:83:9:83:11 | arr indirection [p] | test.cpp:83:14:83:14 | p |
4437
| test.cpp:87:28:87:30 | arr indirection [p] | test.cpp:89:9:89:11 | arr indirection [p] |
4538
| test.cpp:87:28:87:30 | arr indirection [p] | test.cpp:93:9:93:11 | arr indirection [p] |
46-
| test.cpp:89:9:89:11 | arr indirection [p] | test.cpp:89:14:89:14 | p indirection |
47-
| test.cpp:89:14:89:14 | p indirection | test.cpp:89:14:89:14 | p |
48-
| test.cpp:93:9:93:11 | arr indirection [p] | test.cpp:93:14:93:14 | p indirection |
49-
| test.cpp:93:14:93:14 | p indirection | test.cpp:93:14:93:14 | p |
39+
| test.cpp:89:9:89:11 | arr indirection [p] | test.cpp:89:14:89:14 | p |
40+
| test.cpp:93:9:93:11 | arr indirection [p] | test.cpp:93:14:93:14 | p |
5041
| test.cpp:98:18:98:27 | call to mk_array_p indirection [p] | test.cpp:87:28:87:30 | arr indirection [p] |
5142
nodes
5243
| test.cpp:4:17:4:22 | call to malloc | semmle.label | call to malloc |
@@ -60,28 +51,22 @@ nodes
6051
| test.cpp:28:19:28:26 | call to mk_array [p] | semmle.label | call to mk_array [p] |
6152
| test.cpp:31:9:31:11 | arr indirection [p] | semmle.label | arr indirection [p] |
6253
| test.cpp:31:13:31:13 | p | semmle.label | p |
63-
| test.cpp:31:13:31:13 | p indirection | semmle.label | p indirection |
6454
| test.cpp:35:9:35:11 | arr indirection [p] | semmle.label | arr indirection [p] |
6555
| test.cpp:35:13:35:13 | p | semmle.label | p |
66-
| test.cpp:35:13:35:13 | p indirection | semmle.label | p indirection |
6756
| test.cpp:39:27:39:29 | arr [p] | semmle.label | arr [p] |
6857
| test.cpp:41:9:41:11 | arr indirection [p] | semmle.label | arr indirection [p] |
6958
| test.cpp:41:13:41:13 | p | semmle.label | p |
70-
| test.cpp:41:13:41:13 | p indirection | semmle.label | p indirection |
7159
| test.cpp:45:9:45:11 | arr indirection [p] | semmle.label | arr indirection [p] |
7260
| test.cpp:45:13:45:13 | p | semmle.label | p |
73-
| test.cpp:45:13:45:13 | p indirection | semmle.label | p indirection |
7461
| test.cpp:50:18:50:25 | call to mk_array [p] | semmle.label | call to mk_array [p] |
7562
| test.cpp:55:5:55:24 | ... = ... | semmle.label | ... = ... |
7663
| test.cpp:55:9:55:9 | arr indirection [post update] [p] | semmle.label | arr indirection [post update] [p] |
7764
| test.cpp:55:13:55:18 | call to malloc | semmle.label | call to malloc |
7865
| test.cpp:56:5:56:7 | arr indirection [p] | semmle.label | arr indirection [p] |
7966
| test.cpp:59:9:59:11 | arr indirection [p] | semmle.label | arr indirection [p] |
8067
| test.cpp:59:13:59:13 | p | semmle.label | p |
81-
| test.cpp:59:13:59:13 | p indirection | semmle.label | p indirection |
8268
| test.cpp:63:9:63:11 | arr indirection [p] | semmle.label | arr indirection [p] |
8369
| test.cpp:63:13:63:13 | p | semmle.label | p |
84-
| test.cpp:63:13:63:13 | p indirection | semmle.label | p indirection |
8570
| test.cpp:67:10:67:19 | mk_array_p indirection [p] | semmle.label | mk_array_p indirection [p] |
8671
| test.cpp:69:5:69:25 | ... = ... | semmle.label | ... = ... |
8772
| test.cpp:69:10:69:10 | arr indirection [post update] [p] | semmle.label | arr indirection [post update] [p] |
@@ -90,17 +75,13 @@ nodes
9075
| test.cpp:76:20:76:29 | call to mk_array_p indirection [p] | semmle.label | call to mk_array_p indirection [p] |
9176
| test.cpp:79:9:79:11 | arr indirection [p] | semmle.label | arr indirection [p] |
9277
| test.cpp:79:14:79:14 | p | semmle.label | p |
93-
| test.cpp:79:14:79:14 | p indirection | semmle.label | p indirection |
9478
| test.cpp:83:9:83:11 | arr indirection [p] | semmle.label | arr indirection [p] |
9579
| test.cpp:83:14:83:14 | p | semmle.label | p |
96-
| test.cpp:83:14:83:14 | p indirection | semmle.label | p indirection |
9780
| test.cpp:87:28:87:30 | arr indirection [p] | semmle.label | arr indirection [p] |
9881
| test.cpp:89:9:89:11 | arr indirection [p] | semmle.label | arr indirection [p] |
9982
| test.cpp:89:14:89:14 | p | semmle.label | p |
100-
| test.cpp:89:14:89:14 | p indirection | semmle.label | p indirection |
10183
| test.cpp:93:9:93:11 | arr indirection [p] | semmle.label | arr indirection [p] |
10284
| test.cpp:93:14:93:14 | p | semmle.label | p |
103-
| test.cpp:93:14:93:14 | p indirection | semmle.label | p indirection |
10485
| test.cpp:98:18:98:27 | call to mk_array_p indirection [p] | semmle.label | call to mk_array_p indirection [p] |
10586
subpaths
10687
#select

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

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,17 @@ edges
5252
| test.cpp:82:17:82:22 | call to malloc | test.cpp:82:5:82:28 | ... = ... |
5353
| test.cpp:83:5:83:30 | ... = ... | test.cpp:83:9:83:11 | arr indirection [post update] [end] |
5454
| test.cpp:83:9:83:11 | arr indirection [post update] [end] | test.cpp:80:9:80:16 | mk_array indirection [end] |
55-
| test.cpp:83:15:83:17 | arr indirection [begin] | test.cpp:83:19:83:23 | begin indirection |
55+
| test.cpp:83:15:83:17 | arr indirection [begin] | test.cpp:83:5:83:30 | ... = ... |
56+
| test.cpp:83:15:83:17 | arr indirection [begin] | test.cpp:83:15:83:30 | ... + ... |
5657
| test.cpp:83:15:83:30 | ... + ... | test.cpp:83:5:83:30 | ... = ... |
57-
| test.cpp:83:19:83:23 | begin indirection | test.cpp:83:5:83:30 | ... = ... |
58-
| test.cpp:83:19:83:23 | begin indirection | test.cpp:83:15:83:30 | ... + ... |
5958
| test.cpp:89:19:89:26 | call to mk_array [end] | test.cpp:91:36:91:38 | arr indirection [end] |
6059
| test.cpp:89:19:89:26 | call to mk_array [end] | test.cpp:95:36:95:38 | arr indirection [end] |
61-
| test.cpp:91:36:91:38 | arr indirection [end] | test.cpp:91:40:91:42 | end indirection |
6260
| test.cpp:91:36:91:38 | arr indirection [end] | test.cpp:96:9:96:14 | ... = ... |
63-
| test.cpp:91:40:91:42 | end indirection | test.cpp:96:9:96:14 | ... = ... |
64-
| test.cpp:95:36:95:38 | arr indirection [end] | test.cpp:95:40:95:42 | end indirection |
6561
| test.cpp:95:36:95:38 | arr indirection [end] | test.cpp:96:9:96:14 | ... = ... |
66-
| test.cpp:95:40:95:42 | end indirection | test.cpp:96:9:96:14 | ... = ... |
6762
| test.cpp:104:27:104:29 | arr [end] | test.cpp:105:36:105:38 | arr indirection [end] |
6863
| test.cpp:104:27:104:29 | arr [end] | test.cpp:109:36:109:38 | arr indirection [end] |
69-
| test.cpp:105:36:105:38 | arr indirection [end] | test.cpp:105:40:105:42 | end indirection |
7064
| test.cpp:105:36:105:38 | arr indirection [end] | test.cpp:110:9:110:14 | ... = ... |
71-
| test.cpp:105:40:105:42 | end indirection | test.cpp:110:9:110:14 | ... = ... |
72-
| test.cpp:109:36:109:38 | arr indirection [end] | test.cpp:109:40:109:42 | end indirection |
7365
| test.cpp:109:36:109:38 | arr indirection [end] | test.cpp:110:9:110:14 | ... = ... |
74-
| test.cpp:109:40:109:42 | end indirection | test.cpp:110:9:110:14 | ... = ... |
7566
| test.cpp:119:18:119:25 | call to mk_array [end] | test.cpp:104:27:104:29 | arr [end] |
7667
| test.cpp:141:10:141:19 | mk_array_p indirection [end] | test.cpp:150:20:150:29 | call to mk_array_p indirection [end] |
7768
| test.cpp:141:10:141:19 | mk_array_p indirection [end] | test.cpp:180:19:180:28 | call to mk_array_p indirection [end] |
@@ -80,22 +71,15 @@ edges
8071
| test.cpp:143:18:143:23 | call to malloc | test.cpp:143:5:143:29 | ... = ... |
8172
| test.cpp:144:5:144:32 | ... = ... | test.cpp:144:10:144:12 | arr indirection [post update] [end] |
8273
| test.cpp:144:10:144:12 | arr indirection [post update] [end] | test.cpp:141:10:141:19 | mk_array_p indirection [end] |
83-
| test.cpp:144:16:144:18 | arr indirection [begin] | test.cpp:144:21:144:25 | begin indirection |
74+
| test.cpp:144:16:144:18 | arr indirection [begin] | test.cpp:144:5:144:32 | ... = ... |
75+
| test.cpp:144:16:144:18 | arr indirection [begin] | test.cpp:144:16:144:32 | ... + ... |
8476
| test.cpp:144:16:144:32 | ... + ... | test.cpp:144:5:144:32 | ... = ... |
85-
| test.cpp:144:21:144:25 | begin indirection | test.cpp:144:5:144:32 | ... = ... |
86-
| test.cpp:144:21:144:25 | begin indirection | test.cpp:144:16:144:32 | ... + ... |
8777
| test.cpp:150:20:150:29 | call to mk_array_p indirection [end] | test.cpp:156:37:156:39 | arr indirection [end] |
88-
| test.cpp:156:37:156:39 | arr indirection [end] | test.cpp:156:42:156:44 | end indirection |
8978
| test.cpp:156:37:156:39 | arr indirection [end] | test.cpp:157:9:157:14 | ... = ... |
90-
| test.cpp:156:42:156:44 | end indirection | test.cpp:157:9:157:14 | ... = ... |
9179
| test.cpp:165:29:165:31 | arr indirection [end] | test.cpp:166:37:166:39 | arr indirection [end] |
9280
| test.cpp:165:29:165:31 | arr indirection [end] | test.cpp:170:37:170:39 | arr indirection [end] |
93-
| test.cpp:166:37:166:39 | arr indirection [end] | test.cpp:166:42:166:44 | end indirection |
9481
| test.cpp:166:37:166:39 | arr indirection [end] | test.cpp:171:9:171:14 | ... = ... |
95-
| test.cpp:166:42:166:44 | end indirection | test.cpp:171:9:171:14 | ... = ... |
96-
| test.cpp:170:37:170:39 | arr indirection [end] | test.cpp:170:42:170:44 | end indirection |
9782
| test.cpp:170:37:170:39 | arr indirection [end] | test.cpp:171:9:171:14 | ... = ... |
98-
| test.cpp:170:42:170:44 | end indirection | test.cpp:171:9:171:14 | ... = ... |
9983
| test.cpp:180:19:180:28 | call to mk_array_p indirection [end] | test.cpp:165:29:165:31 | arr indirection [end] |
10084
| test.cpp:194:23:194:28 | call to malloc | test.cpp:195:17:195:23 | ... + ... |
10185
| test.cpp:194:23:194:28 | call to malloc | test.cpp:195:17:195:23 | ... + ... |
@@ -268,18 +252,13 @@ nodes
268252
| test.cpp:83:9:83:11 | arr indirection [post update] [end] | semmle.label | arr indirection [post update] [end] |
269253
| test.cpp:83:15:83:17 | arr indirection [begin] | semmle.label | arr indirection [begin] |
270254
| test.cpp:83:15:83:30 | ... + ... | semmle.label | ... + ... |
271-
| test.cpp:83:19:83:23 | begin indirection | semmle.label | begin indirection |
272255
| test.cpp:89:19:89:26 | call to mk_array [end] | semmle.label | call to mk_array [end] |
273256
| test.cpp:91:36:91:38 | arr indirection [end] | semmle.label | arr indirection [end] |
274-
| test.cpp:91:40:91:42 | end indirection | semmle.label | end indirection |
275257
| test.cpp:95:36:95:38 | arr indirection [end] | semmle.label | arr indirection [end] |
276-
| test.cpp:95:40:95:42 | end indirection | semmle.label | end indirection |
277258
| test.cpp:96:9:96:14 | ... = ... | semmle.label | ... = ... |
278259
| test.cpp:104:27:104:29 | arr [end] | semmle.label | arr [end] |
279260
| test.cpp:105:36:105:38 | arr indirection [end] | semmle.label | arr indirection [end] |
280-
| test.cpp:105:40:105:42 | end indirection | semmle.label | end indirection |
281261
| test.cpp:109:36:109:38 | arr indirection [end] | semmle.label | arr indirection [end] |
282-
| test.cpp:109:40:109:42 | end indirection | semmle.label | end indirection |
283262
| test.cpp:110:9:110:14 | ... = ... | semmle.label | ... = ... |
284263
| test.cpp:119:18:119:25 | call to mk_array [end] | semmle.label | call to mk_array [end] |
285264
| test.cpp:141:10:141:19 | mk_array_p indirection [end] | semmle.label | mk_array_p indirection [end] |
@@ -290,16 +269,12 @@ nodes
290269
| test.cpp:144:10:144:12 | arr indirection [post update] [end] | semmle.label | arr indirection [post update] [end] |
291270
| test.cpp:144:16:144:18 | arr indirection [begin] | semmle.label | arr indirection [begin] |
292271
| test.cpp:144:16:144:32 | ... + ... | semmle.label | ... + ... |
293-
| test.cpp:144:21:144:25 | begin indirection | semmle.label | begin indirection |
294272
| test.cpp:150:20:150:29 | call to mk_array_p indirection [end] | semmle.label | call to mk_array_p indirection [end] |
295273
| test.cpp:156:37:156:39 | arr indirection [end] | semmle.label | arr indirection [end] |
296-
| test.cpp:156:42:156:44 | end indirection | semmle.label | end indirection |
297274
| test.cpp:157:9:157:14 | ... = ... | semmle.label | ... = ... |
298275
| test.cpp:165:29:165:31 | arr indirection [end] | semmle.label | arr indirection [end] |
299276
| test.cpp:166:37:166:39 | arr indirection [end] | semmle.label | arr indirection [end] |
300-
| test.cpp:166:42:166:44 | end indirection | semmle.label | end indirection |
301277
| test.cpp:170:37:170:39 | arr indirection [end] | semmle.label | arr indirection [end] |
302-
| test.cpp:170:42:170:44 | end indirection | semmle.label | end indirection |
303278
| test.cpp:171:9:171:14 | ... = ... | semmle.label | ... = ... |
304279
| test.cpp:180:19:180:28 | call to mk_array_p indirection [end] | semmle.label | call to mk_array_p indirection [end] |
305280
| test.cpp:194:23:194:28 | call to malloc | semmle.label | call to malloc |

0 commit comments

Comments
 (0)