Skip to content

Commit fb9fc14

Browse files
committed
C++: Accept test changes in paths.
1 parent 8630630 commit fb9fc14

File tree

37 files changed

+704
-473
lines changed

37 files changed

+704
-473
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ edges
77
| test.cpp:21:5:21:7 | *arr [post update] [p] | test.cpp:22:5:22:7 | *arr [p] | provenance | |
88
| test.cpp:21:5:21:24 | ... = ... | test.cpp:21:5:21:7 | *arr [post update] [p] | provenance | |
99
| test.cpp:21:13:21:18 | call to malloc | test.cpp:21:5:21:24 | ... = ... | provenance | |
10-
| test.cpp:21:13:21:18 | call to malloc | test.cpp:21:13:21:18 | call to malloc | provenance | |
1110
| test.cpp:22:5:22:7 | *arr [p] | test.cpp:24:12:24:14 | arr [p] | provenance | |
1211
| test.cpp:24:12:24:14 | arr [p] | test.cpp:19:9:19:16 | *mk_array [p] | provenance | |
12+
| test.cpp:28:19:28:26 | call to mk_array [p] | test.cpp:28:19:28:26 | call to mk_array [p] | provenance | |
1313
| test.cpp:28:19:28:26 | call to mk_array [p] | test.cpp:31:9:31:11 | *arr [p] | provenance | |
1414
| test.cpp:28:19:28:26 | call to mk_array [p] | test.cpp:35:9:35:11 | *arr [p] | provenance | |
1515
| test.cpp:31:9:31:11 | *arr [p] | test.cpp:31:13:31:13 | p | provenance | |
@@ -22,7 +22,6 @@ edges
2222
| test.cpp:55:5:55:7 | *arr [post update] [p] | test.cpp:56:5:56:7 | *arr [p] | provenance | |
2323
| test.cpp:55:5:55:24 | ... = ... | test.cpp:55:5:55:7 | *arr [post update] [p] | provenance | |
2424
| test.cpp:55:13:55:18 | call to malloc | test.cpp:55:5:55:24 | ... = ... | provenance | |
25-
| test.cpp:55:13:55:18 | call to malloc | test.cpp:55:13:55:18 | call to malloc | provenance | |
2625
| test.cpp:56:5:56:7 | *arr [p] | test.cpp:59:9:59:11 | *arr [p] | provenance | |
2726
| test.cpp:56:5:56:7 | *arr [p] | test.cpp:63:9:63:11 | *arr [p] | provenance | |
2827
| test.cpp:59:9:59:11 | *arr [p] | test.cpp:59:13:59:13 | p | provenance | |
@@ -32,9 +31,9 @@ edges
3231
| test.cpp:69:5:69:7 | *arr [post update] [p] | test.cpp:70:5:70:7 | *arr [p] | provenance | |
3332
| test.cpp:69:5:69:25 | ... = ... | test.cpp:69:5:69:7 | *arr [post update] [p] | provenance | |
3433
| test.cpp:69:14:69:19 | call to malloc | test.cpp:69:5:69:25 | ... = ... | provenance | |
35-
| test.cpp:69:14:69:19 | call to malloc | test.cpp:69:14:69:19 | call to malloc | provenance | |
3634
| test.cpp:70:5:70:7 | *arr [p] | test.cpp:72:12:72:14 | *arr [p] | provenance | |
3735
| test.cpp:72:12:72:14 | *arr [p] | test.cpp:67:10:67:19 | **mk_array_p [p] | provenance | |
36+
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | test.cpp:76:20:76:29 | *call to mk_array_p [p] | provenance | |
3837
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | test.cpp:79:9:79:11 | *arr [p] | provenance | |
3938
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | test.cpp:83:9:83:11 | *arr [p] | provenance | |
4039
| test.cpp:79:9:79:11 | *arr [p] | test.cpp:79:14:79:14 | p | provenance | |
@@ -56,10 +55,10 @@ nodes
5655
| test.cpp:21:5:21:7 | *arr [post update] [p] | semmle.label | *arr [post update] [p] |
5756
| test.cpp:21:5:21:24 | ... = ... | semmle.label | ... = ... |
5857
| test.cpp:21:13:21:18 | call to malloc | semmle.label | call to malloc |
59-
| test.cpp:21:13:21:18 | call to malloc | semmle.label | call to malloc |
6058
| test.cpp:22:5:22:7 | *arr [p] | semmle.label | *arr [p] |
6159
| test.cpp:24:12:24:14 | arr [p] | semmle.label | arr [p] |
6260
| test.cpp:28:19:28:26 | call to mk_array [p] | semmle.label | call to mk_array [p] |
61+
| test.cpp:28:19:28:26 | call to mk_array [p] | semmle.label | call to mk_array [p] |
6362
| test.cpp:31:9:31:11 | *arr [p] | semmle.label | *arr [p] |
6463
| test.cpp:31:13:31:13 | p | semmle.label | p |
6564
| test.cpp:35:9:35:11 | *arr [p] | semmle.label | *arr [p] |
@@ -73,7 +72,6 @@ nodes
7372
| test.cpp:55:5:55:7 | *arr [post update] [p] | semmle.label | *arr [post update] [p] |
7473
| test.cpp:55:5:55:24 | ... = ... | semmle.label | ... = ... |
7574
| test.cpp:55:13:55:18 | call to malloc | semmle.label | call to malloc |
76-
| test.cpp:55:13:55:18 | call to malloc | semmle.label | call to malloc |
7775
| test.cpp:56:5:56:7 | *arr [p] | semmle.label | *arr [p] |
7876
| test.cpp:59:9:59:11 | *arr [p] | semmle.label | *arr [p] |
7977
| test.cpp:59:13:59:13 | p | semmle.label | p |
@@ -83,10 +81,10 @@ nodes
8381
| test.cpp:69:5:69:7 | *arr [post update] [p] | semmle.label | *arr [post update] [p] |
8482
| test.cpp:69:5:69:25 | ... = ... | semmle.label | ... = ... |
8583
| test.cpp:69:14:69:19 | call to malloc | semmle.label | call to malloc |
86-
| test.cpp:69:14:69:19 | call to malloc | semmle.label | call to malloc |
8784
| test.cpp:70:5:70:7 | *arr [p] | semmle.label | *arr [p] |
8885
| test.cpp:72:12:72:14 | *arr [p] | semmle.label | *arr [p] |
8986
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | semmle.label | *call to mk_array_p [p] |
87+
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | semmle.label | *call to mk_array_p [p] |
9088
| test.cpp:79:9:79:11 | *arr [p] | semmle.label | *arr [p] |
9189
| test.cpp:79:14:79:14 | p | semmle.label | p |
9290
| test.cpp:83:9:83:11 | *arr [p] | semmle.label | *arr [p] |
@@ -115,7 +113,6 @@ subpaths
115113
| test.cpp:63:13:63:13 | p | test.cpp:55:13:55:18 | call to malloc | test.cpp:63:13:63:13 | p | Off-by one error allocated at $@ bounded by $@. | test.cpp:55:13:55:18 | call to malloc | call to malloc | test.cpp:56:5:56:19 | ... = ... | ... = ... |
116114
| test.cpp:63:13:63:13 | p | test.cpp:55:13:55:18 | call to malloc | test.cpp:63:13:63:13 | p | Off-by one error allocated at $@ bounded by $@. | test.cpp:55:13:55:18 | call to malloc | call to malloc | test.cpp:56:5:56:19 | ... = ... | ... = ... |
117115
| test.cpp:63:13:63:13 | p | test.cpp:55:13:55:18 | call to malloc | test.cpp:63:13:63:13 | p | Off-by one error allocated at $@ bounded by $@. | test.cpp:55:13:55:18 | call to malloc | call to malloc | test.cpp:56:16:56:19 | size | size |
118-
| test.cpp:63:13:63:13 | p | test.cpp:55:13:55:18 | call to malloc | test.cpp:63:13:63:13 | p | Off-by one error allocated at $@ bounded by $@. | test.cpp:55:13:55:18 | call to malloc | call to malloc | test.cpp:56:16:56:19 | size | size |
119116
| test.cpp:63:13:63:13 | p | test.cpp:55:13:55:18 | call to malloc | test.cpp:63:13:63:13 | p | Off-by one error allocated at $@ bounded by $@. | test.cpp:55:13:55:18 | call to malloc | call to malloc | test.cpp:58:29:58:32 | size | size |
120117
| test.cpp:63:13:63:13 | p | test.cpp:55:13:55:18 | call to malloc | test.cpp:63:13:63:13 | p | Off-by one error allocated at $@ bounded by $@. | test.cpp:55:13:55:18 | call to malloc | call to malloc | test.cpp:62:30:62:33 | size | size |
121118
| test.cpp:83:14:83:14 | p | test.cpp:69:14:69:19 | call to malloc | test.cpp:83:14:83:14 | p | Off-by one error allocated at $@ bounded by $@. | test.cpp:69:14:69:19 | call to malloc | call to malloc | test.cpp:82:31:82:34 | size | size |

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

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ edges
1818
| test.cpp:77:32:77:34 | buf | test.cpp:77:26:77:44 | & ... | provenance | |
1919
| test.cpp:79:27:79:34 | buf | test.cpp:70:33:70:33 | p | provenance | |
2020
| test.cpp:79:32:79:34 | buf | test.cpp:79:27:79:34 | buf | provenance | |
21-
| test.cpp:85:21:85:36 | buf | test.cpp:87:5:87:31 | access to array | provenance | |
22-
| test.cpp:85:21:85:36 | buf | test.cpp:88:5:88:27 | access to array | provenance | |
23-
| test.cpp:85:34:85:36 | buf | test.cpp:85:21:85:36 | buf | provenance | |
21+
| test.cpp:85:21:85:36 | (char *)... | test.cpp:87:5:87:31 | access to array | provenance | |
22+
| test.cpp:85:21:85:36 | (char *)... | test.cpp:88:5:88:27 | access to array | provenance | |
23+
| test.cpp:85:34:85:36 | buf | test.cpp:85:21:85:36 | (char *)... | provenance | |
2424
| test.cpp:96:13:96:15 | arr | test.cpp:96:13:96:18 | access to array | provenance | |
2525
| test.cpp:111:17:111:19 | arr | test.cpp:111:17:111:22 | access to array | provenance | |
2626
| test.cpp:111:17:111:19 | arr | test.cpp:115:35:115:40 | access to array | provenance | |
@@ -33,19 +33,21 @@ edges
3333
| test.cpp:119:17:119:19 | arr | test.cpp:119:17:119:22 | access to array | provenance | |
3434
| test.cpp:128:9:128:11 | arr | test.cpp:128:9:128:14 | access to array | provenance | |
3535
| test.cpp:134:25:134:27 | arr | test.cpp:136:9:136:16 | ... += ... | provenance | |
36+
| test.cpp:136:9:136:16 | ... += ... | test.cpp:136:9:136:16 | ... += ... | provenance | |
3637
| test.cpp:136:9:136:16 | ... += ... | test.cpp:138:13:138:15 | arr | provenance | |
3738
| test.cpp:143:18:143:21 | asdf | test.cpp:134:25:134:27 | arr | provenance | |
3839
| test.cpp:143:18:143:21 | asdf | test.cpp:143:18:143:21 | asdf | provenance | |
3940
| test.cpp:146:26:146:26 | *p | test.cpp:147:4:147:9 | -- ... | provenance | |
4041
| test.cpp:156:12:156:14 | buf | test.cpp:156:12:156:18 | ... + ... | provenance | |
42+
| test.cpp:156:12:156:18 | ... + ... | test.cpp:156:12:156:18 | ... + ... | provenance | |
4143
| test.cpp:156:12:156:18 | ... + ... | test.cpp:158:17:158:18 | *& ... | provenance | |
4244
| test.cpp:158:17:158:18 | *& ... | test.cpp:146:26:146:26 | *p | provenance | |
43-
| test.cpp:218:16:218:28 | buffer | test.cpp:220:5:220:11 | access to array | provenance | |
44-
| test.cpp:218:16:218:28 | buffer | test.cpp:221:5:221:11 | access to array | provenance | |
45-
| test.cpp:218:23:218:28 | buffer | test.cpp:218:16:218:28 | buffer | provenance | |
46-
| test.cpp:229:17:229:29 | array | test.cpp:231:5:231:10 | access to array | provenance | |
47-
| test.cpp:229:17:229:29 | array | test.cpp:232:5:232:10 | access to array | provenance | |
48-
| test.cpp:229:25:229:29 | array | test.cpp:229:17:229:29 | array | provenance | |
45+
| test.cpp:218:16:218:28 | (int *)... | test.cpp:220:5:220:11 | access to array | provenance | |
46+
| test.cpp:218:16:218:28 | (int *)... | test.cpp:221:5:221:11 | access to array | provenance | |
47+
| test.cpp:218:23:218:28 | buffer | test.cpp:218:16:218:28 | (int *)... | provenance | |
48+
| test.cpp:229:17:229:29 | (vec2 *)... | test.cpp:231:5:231:10 | access to array | provenance | |
49+
| test.cpp:229:17:229:29 | (vec2 *)... | test.cpp:232:5:232:10 | access to array | provenance | |
50+
| test.cpp:229:25:229:29 | array | test.cpp:229:17:229:29 | (vec2 *)... | provenance | |
4951
| test.cpp:245:30:245:30 | p | test.cpp:261:27:261:30 | access to array | provenance | |
5052
| test.cpp:245:30:245:30 | p | test.cpp:261:27:261:30 | access to array | provenance | |
5153
| test.cpp:274:14:274:20 | buffer3 | test.cpp:245:30:245:30 | p | provenance | |
@@ -64,13 +66,16 @@ edges
6466
| test.cpp:306:20:306:23 | arr1 | test.cpp:306:20:306:23 | arr1 | provenance | |
6567
| test.cpp:309:20:309:23 | arr2 | test.cpp:292:25:292:27 | arr | provenance | |
6668
| test.cpp:309:20:309:23 | arr2 | test.cpp:309:20:309:23 | arr2 | provenance | |
69+
| test.cpp:319:13:319:27 | ... = ... | test.cpp:325:24:325:26 | end | provenance | |
6770
| test.cpp:319:19:319:22 | temp | test.cpp:319:19:319:27 | ... + ... | provenance | |
6871
| test.cpp:319:19:319:22 | temp | test.cpp:324:23:324:32 | ... + ... | provenance | |
69-
| test.cpp:319:19:319:27 | ... + ... | test.cpp:325:24:325:26 | end | provenance | |
72+
| test.cpp:319:19:319:27 | ... + ... | test.cpp:319:13:319:27 | ... = ... | provenance | |
73+
| test.cpp:322:13:322:27 | ... = ... | test.cpp:325:24:325:26 | end | provenance | |
7074
| test.cpp:322:19:322:22 | temp | test.cpp:322:19:322:27 | ... + ... | provenance | |
7175
| test.cpp:322:19:322:22 | temp | test.cpp:324:23:324:32 | ... + ... | provenance | |
72-
| test.cpp:322:19:322:27 | ... + ... | test.cpp:325:24:325:26 | end | provenance | |
76+
| test.cpp:322:19:322:27 | ... + ... | test.cpp:322:13:322:27 | ... = ... | provenance | |
7377
| test.cpp:324:23:324:26 | temp | test.cpp:324:23:324:32 | ... + ... | provenance | |
78+
| test.cpp:324:23:324:32 | ... + ... | test.cpp:324:23:324:32 | ... + ... | provenance | |
7479
| test.cpp:324:23:324:32 | ... + ... | test.cpp:325:15:325:19 | temp2 | provenance | |
7580
nodes
7681
| test.cpp:34:5:34:24 | access to array | semmle.label | access to array |
@@ -106,7 +111,7 @@ nodes
106111
| test.cpp:77:32:77:34 | buf | semmle.label | buf |
107112
| test.cpp:79:27:79:34 | buf | semmle.label | buf |
108113
| test.cpp:79:32:79:34 | buf | semmle.label | buf |
109-
| test.cpp:85:21:85:36 | buf | semmle.label | buf |
114+
| test.cpp:85:21:85:36 | (char *)... | semmle.label | (char *)... |
110115
| test.cpp:85:34:85:36 | buf | semmle.label | buf |
111116
| test.cpp:87:5:87:31 | access to array | semmle.label | access to array |
112117
| test.cpp:88:5:88:27 | access to array | semmle.label | access to array |
@@ -122,19 +127,21 @@ nodes
122127
| test.cpp:128:9:128:14 | access to array | semmle.label | access to array |
123128
| test.cpp:134:25:134:27 | arr | semmle.label | arr |
124129
| test.cpp:136:9:136:16 | ... += ... | semmle.label | ... += ... |
130+
| test.cpp:136:9:136:16 | ... += ... | semmle.label | ... += ... |
125131
| test.cpp:138:13:138:15 | arr | semmle.label | arr |
126132
| test.cpp:143:18:143:21 | asdf | semmle.label | asdf |
127133
| test.cpp:143:18:143:21 | asdf | semmle.label | asdf |
128134
| test.cpp:146:26:146:26 | *p | semmle.label | *p |
129135
| test.cpp:147:4:147:9 | -- ... | semmle.label | -- ... |
130136
| test.cpp:156:12:156:14 | buf | semmle.label | buf |
131137
| test.cpp:156:12:156:18 | ... + ... | semmle.label | ... + ... |
138+
| test.cpp:156:12:156:18 | ... + ... | semmle.label | ... + ... |
132139
| test.cpp:158:17:158:18 | *& ... | semmle.label | *& ... |
133-
| test.cpp:218:16:218:28 | buffer | semmle.label | buffer |
140+
| test.cpp:218:16:218:28 | (int *)... | semmle.label | (int *)... |
134141
| test.cpp:218:23:218:28 | buffer | semmle.label | buffer |
135142
| test.cpp:220:5:220:11 | access to array | semmle.label | access to array |
136143
| test.cpp:221:5:221:11 | access to array | semmle.label | access to array |
137-
| test.cpp:229:17:229:29 | array | semmle.label | array |
144+
| test.cpp:229:17:229:29 | (vec2 *)... | semmle.label | (vec2 *)... |
138145
| test.cpp:229:25:229:29 | array | semmle.label | array |
139146
| test.cpp:231:5:231:10 | access to array | semmle.label | access to array |
140147
| test.cpp:232:5:232:10 | access to array | semmle.label | access to array |
@@ -158,12 +165,15 @@ nodes
158165
| test.cpp:306:20:306:23 | arr1 | semmle.label | arr1 |
159166
| test.cpp:309:20:309:23 | arr2 | semmle.label | arr2 |
160167
| test.cpp:309:20:309:23 | arr2 | semmle.label | arr2 |
168+
| test.cpp:319:13:319:27 | ... = ... | semmle.label | ... = ... |
161169
| test.cpp:319:19:319:22 | temp | semmle.label | temp |
162170
| test.cpp:319:19:319:27 | ... + ... | semmle.label | ... + ... |
171+
| test.cpp:322:13:322:27 | ... = ... | semmle.label | ... = ... |
163172
| test.cpp:322:19:322:22 | temp | semmle.label | temp |
164173
| test.cpp:322:19:322:27 | ... + ... | semmle.label | ... + ... |
165174
| test.cpp:324:23:324:26 | temp | semmle.label | temp |
166175
| test.cpp:324:23:324:32 | ... + ... | semmle.label | ... + ... |
176+
| test.cpp:324:23:324:32 | ... + ... | semmle.label | ... + ... |
167177
| test.cpp:325:15:325:19 | temp2 | semmle.label | temp2 |
168178
| test.cpp:325:24:325:26 | end | semmle.label | end |
169179
| test.cpp:325:24:325:26 | end | semmle.label | end |

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-359/semmle/tests/PrivateCleartextWrite.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ edges
22
| test.cpp:45:18:45:23 | buffer | test.cpp:47:10:47:15 | buffer | provenance | |
33
| test.cpp:47:10:47:15 | buffer | test.cpp:45:7:45:10 | *func | provenance | |
44
| test.cpp:74:24:74:30 | medical | test.cpp:77:16:77:22 | medical | provenance | |
5+
| test.cpp:74:24:74:30 | medical | test.cpp:81:22:81:28 | medical | provenance | |
6+
| test.cpp:77:16:77:22 | medical | test.cpp:77:16:77:22 | medical | provenance | |
57
| test.cpp:77:16:77:22 | medical | test.cpp:78:24:78:27 | temp | provenance | |
68
| test.cpp:77:16:77:22 | medical | test.cpp:81:22:81:28 | medical | provenance | |
9+
| test.cpp:81:17:81:20 | call to func | test.cpp:81:17:81:20 | call to func | provenance | |
710
| test.cpp:81:17:81:20 | call to func | test.cpp:82:24:82:28 | buff5 | provenance | |
811
| test.cpp:81:22:81:28 | medical | test.cpp:45:18:45:23 | buffer | provenance | |
912
| test.cpp:81:22:81:28 | medical | test.cpp:81:17:81:20 | call to func | provenance | |
@@ -17,8 +20,10 @@ nodes
1720
| test.cpp:74:24:74:30 | medical | semmle.label | medical |
1821
| test.cpp:74:24:74:30 | medical | semmle.label | medical |
1922
| test.cpp:77:16:77:22 | medical | semmle.label | medical |
23+
| test.cpp:77:16:77:22 | medical | semmle.label | medical |
2024
| test.cpp:78:24:78:27 | temp | semmle.label | temp |
2125
| test.cpp:81:17:81:20 | call to func | semmle.label | call to func |
26+
| test.cpp:81:17:81:20 | call to func | semmle.label | call to func |
2227
| test.cpp:81:22:81:28 | medical | semmle.label | medical |
2328
| test.cpp:82:24:82:28 | buff5 | semmle.label | buff5 |
2429
| test.cpp:96:37:96:46 | theZipcode | semmle.label | theZipcode |

0 commit comments

Comments
 (0)