Skip to content

Commit f3a5ce5

Browse files
committed
C++: Accept more test changes.
1 parent 6f08790 commit f3a5ce5

File tree

5 files changed

+54
-18
lines changed

5 files changed

+54
-18
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-078/WordexpTainted.expected

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
edges
2-
| test.cpp:22:27:22:30 | **argv | test.cpp:29:13:29:20 | *filePath | provenance | |
2+
| test.cpp:22:27:22:30 | **argv | test.cpp:23:20:23:26 | *access to array | provenance | |
3+
| test.cpp:23:20:23:26 | *access to array | test.cpp:29:13:29:20 | *filePath | provenance | |
34
nodes
45
| test.cpp:22:27:22:30 | **argv | semmle.label | **argv |
6+
| test.cpp:23:20:23:26 | *access to array | semmle.label | *access to array |
57
| test.cpp:29:13:29:20 | *filePath | semmle.label | *filePath |
68
subpaths
79
#select

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
edges
2+
| test.cpp:4:17:4:22 | call to malloc | test.cpp:4:17:4:22 | call to malloc | provenance | |
23
| test.cpp:4:17:4:22 | call to malloc | test.cpp:6:9:6:11 | arr | provenance | |
34
| test.cpp:4:17:4:22 | call to malloc | test.cpp:10:9:10:11 | arr | provenance | |
45
| test.cpp:19:9:19:16 | *mk_array [p] | test.cpp:28:19:28:26 | call to mk_array [p] | provenance | |
56
| test.cpp:19:9:19:16 | *mk_array [p] | test.cpp:50:18:50:25 | call to mk_array [p] | provenance | |
67
| test.cpp:21:5:21:7 | *arr [post update] [p] | test.cpp:22:5:22:7 | *arr [p] | provenance | |
78
| test.cpp:21:5:21:24 | ... = ... | test.cpp:21:5:21:7 | *arr [post update] [p] | provenance | |
89
| test.cpp:21:13:21:18 | call to malloc | test.cpp:21:5:21:24 | ... = ... | provenance | |
9-
| test.cpp:22:5:22:7 | *arr [p] | test.cpp:19:9:19:16 | *mk_array [p] | provenance | |
10+
| test.cpp:21:13:21:18 | call to malloc | test.cpp:21:13:21:18 | call to malloc | provenance | |
11+
| test.cpp:22:5:22:7 | *arr [p] | test.cpp:24:12:24:14 | arr [p] | provenance | |
12+
| test.cpp:24:12:24:14 | arr [p] | test.cpp:19:9:19:16 | *mk_array [p] | provenance | |
1013
| test.cpp:28:19:28:26 | call to mk_array [p] | test.cpp:31:9:31:11 | *arr [p] | provenance | |
1114
| test.cpp:28:19:28:26 | call to mk_array [p] | test.cpp:35:9:35:11 | *arr [p] | provenance | |
1215
| test.cpp:31:9:31:11 | *arr [p] | test.cpp:31:13:31:13 | p | provenance | |
@@ -19,6 +22,7 @@ edges
1922
| test.cpp:55:5:55:7 | *arr [post update] [p] | test.cpp:56:5:56:7 | *arr [p] | provenance | |
2023
| test.cpp:55:5:55:24 | ... = ... | test.cpp:55:5:55:7 | *arr [post update] [p] | provenance | |
2124
| 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 | |
2226
| test.cpp:56:5:56:7 | *arr [p] | test.cpp:59:9:59:11 | *arr [p] | provenance | |
2327
| test.cpp:56:5:56:7 | *arr [p] | test.cpp:63:9:63:11 | *arr [p] | provenance | |
2428
| test.cpp:59:9:59:11 | *arr [p] | test.cpp:59:13:59:13 | p | provenance | |
@@ -28,7 +32,9 @@ edges
2832
| test.cpp:69:5:69:7 | *arr [post update] [p] | test.cpp:70:5:70:7 | *arr [p] | provenance | |
2933
| test.cpp:69:5:69:25 | ... = ... | test.cpp:69:5:69:7 | *arr [post update] [p] | provenance | |
3034
| test.cpp:69:14:69:19 | call to malloc | test.cpp:69:5:69:25 | ... = ... | provenance | |
31-
| test.cpp:70:5:70:7 | *arr [p] | test.cpp:67:10:67:19 | **mk_array_p [p] | provenance | |
35+
| test.cpp:69:14:69:19 | call to malloc | test.cpp:69:14:69:19 | call to malloc | provenance | |
36+
| test.cpp:70:5:70:7 | *arr [p] | test.cpp:72:12:72:14 | *arr [p] | provenance | |
37+
| test.cpp:72:12:72:14 | *arr [p] | test.cpp:67:10:67:19 | **mk_array_p [p] | provenance | |
3238
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | test.cpp:79:9:79:11 | *arr [p] | provenance | |
3339
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | test.cpp:83:9:83:11 | *arr [p] | provenance | |
3440
| test.cpp:79:9:79:11 | *arr [p] | test.cpp:79:14:79:14 | p | provenance | |
@@ -43,13 +49,16 @@ edges
4349
| test.cpp:98:18:98:27 | test6_callee output argument [p] | test.cpp:98:18:98:27 | *call to mk_array_p [p] | provenance | |
4450
nodes
4551
| test.cpp:4:17:4:22 | call to malloc | semmle.label | call to malloc |
52+
| test.cpp:4:17:4:22 | call to malloc | semmle.label | call to malloc |
4653
| test.cpp:6:9:6:11 | arr | semmle.label | arr |
4754
| test.cpp:10:9:10:11 | arr | semmle.label | arr |
4855
| test.cpp:19:9:19:16 | *mk_array [p] | semmle.label | *mk_array [p] |
4956
| test.cpp:21:5:21:7 | *arr [post update] [p] | semmle.label | *arr [post update] [p] |
5057
| test.cpp:21:5:21:24 | ... = ... | semmle.label | ... = ... |
5158
| 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 |
5260
| test.cpp:22:5:22:7 | *arr [p] | semmle.label | *arr [p] |
61+
| test.cpp:24:12:24:14 | arr [p] | semmle.label | arr [p] |
5362
| test.cpp:28:19:28:26 | call to mk_array [p] | semmle.label | call to mk_array [p] |
5463
| test.cpp:31:9:31:11 | *arr [p] | semmle.label | *arr [p] |
5564
| test.cpp:31:13:31:13 | p | semmle.label | p |
@@ -64,6 +73,7 @@ nodes
6473
| test.cpp:55:5:55:7 | *arr [post update] [p] | semmle.label | *arr [post update] [p] |
6574
| test.cpp:55:5:55:24 | ... = ... | semmle.label | ... = ... |
6675
| 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 |
6777
| test.cpp:56:5:56:7 | *arr [p] | semmle.label | *arr [p] |
6878
| test.cpp:59:9:59:11 | *arr [p] | semmle.label | *arr [p] |
6979
| test.cpp:59:13:59:13 | p | semmle.label | p |
@@ -73,7 +83,9 @@ nodes
7383
| test.cpp:69:5:69:7 | *arr [post update] [p] | semmle.label | *arr [post update] [p] |
7484
| test.cpp:69:5:69:25 | ... = ... | semmle.label | ... = ... |
7585
| 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 |
7687
| test.cpp:70:5:70:7 | *arr [p] | semmle.label | *arr [p] |
88+
| test.cpp:72:12:72:14 | *arr [p] | semmle.label | *arr [p] |
7789
| test.cpp:76:20:76:29 | *call to mk_array_p [p] | semmle.label | *call to mk_array_p [p] |
7890
| test.cpp:79:9:79:11 | *arr [p] | semmle.label | *arr [p] |
7991
| test.cpp:79:14:79:14 | p | semmle.label | p |
@@ -103,6 +115,7 @@ subpaths
103115
| 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 | ... = ... | ... = ... |
104116
| 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 | ... = ... | ... = ... |
105117
| 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 |
106119
| 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 |
107120
| 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 |
108121
| 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: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +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:34:85:36 | buf | test.cpp:87:5:87:31 | access to array | provenance | |
22-
| test.cpp:85:34:85:36 | buf | test.cpp:88:5:88:27 | access to array | 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 | |
2324
| test.cpp:96:13:96:15 | arr | test.cpp:96:13:96:18 | access to array | provenance | |
2425
| test.cpp:111:17:111:19 | arr | test.cpp:111:17:111:22 | access to array | provenance | |
2526
| test.cpp:111:17:111:19 | arr | test.cpp:115:35:115:40 | access to array | provenance | |
@@ -39,10 +40,12 @@ edges
3940
| test.cpp:156:12:156:14 | buf | test.cpp:156:12:156:18 | ... + ... | provenance | |
4041
| test.cpp:156:12:156:18 | ... + ... | test.cpp:158:17:158:18 | *& ... | provenance | |
4142
| test.cpp:158:17:158:18 | *& ... | test.cpp:146:26:146:26 | *p | provenance | |
42-
| test.cpp:218:23:218:28 | buffer | test.cpp:220:5:220:11 | access to array | provenance | |
43-
| test.cpp:218:23:218:28 | buffer | test.cpp:221:5:221:11 | access to array | provenance | |
44-
| test.cpp:229:25:229:29 | array | test.cpp:231:5:231:10 | access to array | provenance | |
45-
| test.cpp:229:25:229:29 | array | test.cpp:232:5:232:10 | access to array | 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 | |
4649
| test.cpp:245:30:245:30 | p | test.cpp:261:27:261:30 | access to array | provenance | |
4750
| test.cpp:245:30:245:30 | p | test.cpp:261:27:261:30 | access to array | provenance | |
4851
| test.cpp:274:14:274:20 | buffer3 | test.cpp:245:30:245:30 | p | provenance | |
@@ -103,6 +106,7 @@ nodes
103106
| test.cpp:77:32:77:34 | buf | semmle.label | buf |
104107
| test.cpp:79:27:79:34 | buf | semmle.label | buf |
105108
| test.cpp:79:32:79:34 | buf | semmle.label | buf |
109+
| test.cpp:85:21:85:36 | buf | semmle.label | buf |
106110
| test.cpp:85:34:85:36 | buf | semmle.label | buf |
107111
| test.cpp:87:5:87:31 | access to array | semmle.label | access to array |
108112
| test.cpp:88:5:88:27 | access to array | semmle.label | access to array |
@@ -126,9 +130,11 @@ nodes
126130
| test.cpp:156:12:156:14 | buf | semmle.label | buf |
127131
| test.cpp:156:12:156:18 | ... + ... | semmle.label | ... + ... |
128132
| test.cpp:158:17:158:18 | *& ... | semmle.label | *& ... |
133+
| test.cpp:218:16:218:28 | buffer | semmle.label | buffer |
129134
| test.cpp:218:23:218:28 | buffer | semmle.label | buffer |
130135
| test.cpp:220:5:220:11 | access to array | semmle.label | access to array |
131136
| 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 |
132138
| test.cpp:229:25:229:29 | array | semmle.label | array |
133139
| test.cpp:231:5:231:10 | access to array | semmle.label | access to array |
134140
| test.cpp:232:5:232:10 | access to array | semmle.label | access to array |

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
edges
2-
| test.cpp:45:18:45:23 | buffer | test.cpp:45:7:45:10 | *func | provenance | |
3-
| test.cpp:74:24:74:30 | medical | test.cpp:78:24:78:27 | temp | provenance | |
4-
| test.cpp:74:24:74:30 | medical | test.cpp:81:22:81:28 | medical | provenance | |
2+
| test.cpp:45:18:45:23 | buffer | test.cpp:47:10:47:15 | buffer | provenance | |
3+
| test.cpp:47:10:47:15 | buffer | test.cpp:45:7:45:10 | *func | provenance | |
4+
| test.cpp:74:24:74:30 | medical | test.cpp:77:16:77:22 | medical | provenance | |
55
| test.cpp:77:16:77:22 | medical | test.cpp:78:24:78:27 | temp | provenance | |
66
| test.cpp:77:16:77:22 | medical | test.cpp:81:22:81:28 | medical | provenance | |
77
| test.cpp:81:17:81:20 | call to func | test.cpp:82:24:82:28 | buff5 | provenance | |
@@ -12,6 +12,7 @@ edges
1212
nodes
1313
| test.cpp:45:7:45:10 | *func | semmle.label | *func |
1414
| test.cpp:45:18:45:23 | buffer | semmle.label | buffer |
15+
| test.cpp:47:10:47:15 | buffer | semmle.label | buffer |
1516
| test.cpp:57:9:57:18 | theZipcode | semmle.label | theZipcode |
1617
| test.cpp:74:24:74:30 | medical | semmle.label | medical |
1718
| test.cpp:74:24:74:30 | medical | semmle.label | medical |

cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/NonConstantFormat.expected

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ edges
1414
| test.cpp:193:32:193:34 | *str | test.cpp:197:11:197:14 | *wstr | provenance | TaintFunction |
1515
| test.cpp:204:25:204:36 | *call to get_string | test.cpp:205:12:205:20 | *... + ... | provenance | |
1616
| test.cpp:204:25:204:36 | *call to get_string | test.cpp:206:12:206:16 | *hello | provenance | |
17-
| test.cpp:209:25:209:36 | *call to get_string | test.cpp:211:12:211:16 | *hello | provenance | |
18-
| test.cpp:215:25:215:36 | *call to get_string | test.cpp:217:12:217:16 | *hello | provenance | |
19-
| test.cpp:221:25:221:36 | *call to get_string | test.cpp:223:12:223:16 | *hello | provenance | |
17+
| test.cpp:209:25:209:36 | *call to get_string | test.cpp:210:5:210:14 | *... += ... | provenance | |
18+
| test.cpp:210:5:210:14 | *... += ... | test.cpp:211:12:211:16 | *hello | provenance | |
19+
| test.cpp:215:25:215:36 | *call to get_string | test.cpp:216:13:216:21 | *... + ... | provenance | |
20+
| test.cpp:216:13:216:21 | *... + ... | test.cpp:217:12:217:16 | *hello | provenance | |
21+
| test.cpp:221:25:221:36 | *call to get_string | test.cpp:222:5:222:11 | *... ++ | provenance | |
22+
| test.cpp:222:5:222:11 | *... ++ | test.cpp:223:12:223:16 | *hello | provenance | |
2023
| test.cpp:227:25:227:36 | *call to get_string | test.cpp:228:12:228:18 | *++ ... | provenance | |
21-
| test.cpp:232:25:232:36 | *call to get_string | test.cpp:235:12:235:16 | *hello | provenance | |
22-
| test.cpp:239:25:239:36 | *call to get_string | test.cpp:242:12:242:16 | *hello | provenance | |
23-
| test.cpp:245:25:245:36 | *call to get_string | test.cpp:247:12:247:16 | *hello | provenance | |
24+
| test.cpp:228:12:228:18 | *++ ... | test.cpp:228:12:228:18 | *++ ... | provenance | |
25+
| test.cpp:232:25:232:36 | *call to get_string | test.cpp:233:22:233:27 | **& ... | provenance | |
26+
| test.cpp:233:22:233:27 | **& ... | test.cpp:235:12:235:16 | *hello | provenance | |
27+
| test.cpp:239:25:239:36 | *call to get_string | test.cpp:240:22:240:26 | **(reference to) | provenance | |
28+
| test.cpp:240:22:240:26 | **(reference to) | test.cpp:242:12:242:16 | *hello | provenance | |
29+
| test.cpp:245:25:245:36 | *call to get_string | test.cpp:246:28:246:33 | **(const char *const *)... | provenance | |
30+
| test.cpp:246:28:246:33 | **(const char *const *)... | test.cpp:247:12:247:16 | *hello | provenance | |
2431
nodes
2532
| NonConstantFormat.c:28:27:28:30 | **argv | semmle.label | **argv |
2633
| NonConstantFormat.c:30:10:30:16 | *access to array | semmle.label | *access to array |
@@ -48,18 +55,25 @@ nodes
4855
| test.cpp:205:12:205:20 | *... + ... | semmle.label | *... + ... |
4956
| test.cpp:206:12:206:16 | *hello | semmle.label | *hello |
5057
| test.cpp:209:25:209:36 | *call to get_string | semmle.label | *call to get_string |
58+
| test.cpp:210:5:210:14 | *... += ... | semmle.label | *... += ... |
5159
| test.cpp:211:12:211:16 | *hello | semmle.label | *hello |
5260
| test.cpp:215:25:215:36 | *call to get_string | semmle.label | *call to get_string |
61+
| test.cpp:216:13:216:21 | *... + ... | semmle.label | *... + ... |
5362
| test.cpp:217:12:217:16 | *hello | semmle.label | *hello |
5463
| test.cpp:221:25:221:36 | *call to get_string | semmle.label | *call to get_string |
64+
| test.cpp:222:5:222:11 | *... ++ | semmle.label | *... ++ |
5565
| test.cpp:223:12:223:16 | *hello | semmle.label | *hello |
5666
| test.cpp:227:25:227:36 | *call to get_string | semmle.label | *call to get_string |
5767
| test.cpp:228:12:228:18 | *++ ... | semmle.label | *++ ... |
68+
| test.cpp:228:12:228:18 | *++ ... | semmle.label | *++ ... |
5869
| test.cpp:232:25:232:36 | *call to get_string | semmle.label | *call to get_string |
70+
| test.cpp:233:22:233:27 | **& ... | semmle.label | **& ... |
5971
| test.cpp:235:12:235:16 | *hello | semmle.label | *hello |
6072
| test.cpp:239:25:239:36 | *call to get_string | semmle.label | *call to get_string |
73+
| test.cpp:240:22:240:26 | **(reference to) | semmle.label | **(reference to) |
6174
| test.cpp:242:12:242:16 | *hello | semmle.label | *hello |
6275
| test.cpp:245:25:245:36 | *call to get_string | semmle.label | *call to get_string |
76+
| test.cpp:246:28:246:33 | **(const char *const *)... | semmle.label | **(const char *const *)... |
6377
| test.cpp:247:12:247:16 | *hello | semmle.label | *hello |
6478
subpaths
6579
#select

0 commit comments

Comments
 (0)