Skip to content

Commit 04b8432

Browse files
committed
C++: Accept more query-test changes.
1 parent 3906a19 commit 04b8432

File tree

6 files changed

+20
-51
lines changed

6 files changed

+20
-51
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ edges
33
| test.cpp:22:27:22:30 | argv | test.cpp:29:13:29:20 | filePath |
44
| test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath |
55
| test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath |
6-
| test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath |
7-
| test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath |
86
nodes
97
| test.cpp:22:27:22:30 | argv | semmle.label | argv |
108
| test.cpp:22:27:22:30 | argv indirection | semmle.label | argv indirection |
11-
| test.cpp:22:27:22:30 | argv indirection | semmle.label | argv indirection |
129
| test.cpp:29:13:29:20 | filePath | semmle.label | filePath |
1310
| test.cpp:29:13:29:20 | filePath | semmle.label | filePath |
1411
subpaths
@@ -17,5 +14,3 @@ subpaths
1714
| test.cpp:29:13:29:20 | filePath | test.cpp:22:27:22:30 | argv | test.cpp:29:13:29:20 | filePath | Using user-supplied data in a `wordexp` command, without disabling command substitution, can make code vulnerable to command injection. |
1815
| test.cpp:29:13:29:20 | filePath | test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath | Using user-supplied data in a `wordexp` command, without disabling command substitution, can make code vulnerable to command injection. |
1916
| test.cpp:29:13:29:20 | filePath | test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath | Using user-supplied data in a `wordexp` command, without disabling command substitution, can make code vulnerable to command injection. |
20-
| test.cpp:29:13:29:20 | filePath | test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath | Using user-supplied data in a `wordexp` command, without disabling command substitution, can make code vulnerable to command injection. |
21-
| test.cpp:29:13:29:20 | filePath | test.cpp:22:27:22:30 | argv indirection | test.cpp:29:13:29:20 | filePath | Using user-supplied data in a `wordexp` command, without disabling command substitution, can make code vulnerable to command injection. |
Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
11
edges
22
| test.cpp:45:18:45:23 | buffer | test.cpp:45:7:45:10 | func indirection |
33
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode |
4-
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode |
5-
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode |
6-
| test.cpp:74:24:74:30 | medical | test.cpp:74:11:74:15 | buff1 |
7-
| test.cpp:74:24:74:30 | medical | test.cpp:78:11:78:15 | buff2 |
84
| test.cpp:74:24:74:30 | medical | test.cpp:78:24:78:27 | temp |
95
| test.cpp:74:24:74:30 | medical | test.cpp:81:22:81:28 | medical |
10-
| test.cpp:77:16:77:22 | medical | test.cpp:78:11:78:15 | buff2 |
116
| test.cpp:77:16:77:22 | medical | test.cpp:78:24:78:27 | temp |
127
| test.cpp:77:16:77:22 | medical | test.cpp:81:22:81:28 | medical |
13-
| test.cpp:81:17:81:20 | call to func | test.cpp:82:11:82:15 | buff3 |
148
| test.cpp:81:17:81:20 | call to func | test.cpp:82:24:82:28 | buff5 |
159
| test.cpp:81:22:81:28 | medical | test.cpp:45:18:45:23 | buffer |
1610
| test.cpp:81:22:81:28 | medical | test.cpp:81:17:81:20 | call to func |
1711
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode |
1812
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode |
19-
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode |
20-
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode |
2113
| test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
2214
| test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
2315
| test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
2416
| test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
2517
| test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
2618
| test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
2719
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
28-
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
29-
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
3020
| test.cpp:99:61:99:70 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
3121
| test.cpp:99:61:99:70 | theZipcode | test.cpp:99:42:99:51 | theZipcode |
3222
nodes
@@ -35,15 +25,12 @@ nodes
3525
| test.cpp:57:9:57:18 | theZipcode | semmle.label | theZipcode |
3626
| test.cpp:57:9:57:18 | theZipcode | semmle.label | theZipcode |
3727
| test.cpp:57:9:57:18 | theZipcode | semmle.label | theZipcode |
38-
| test.cpp:74:11:74:15 | buff1 | semmle.label | buff1 |
3928
| test.cpp:74:24:74:30 | medical | semmle.label | medical |
4029
| test.cpp:74:24:74:30 | medical | semmle.label | medical |
4130
| test.cpp:77:16:77:22 | medical | semmle.label | medical |
42-
| test.cpp:78:11:78:15 | buff2 | semmle.label | buff2 |
4331
| test.cpp:78:24:78:27 | temp | semmle.label | temp |
4432
| test.cpp:81:17:81:20 | call to func | semmle.label | call to func |
4533
| test.cpp:81:22:81:28 | medical | semmle.label | medical |
46-
| test.cpp:82:11:82:15 | buff3 | semmle.label | buff3 |
4734
| test.cpp:82:24:82:28 | buff5 | semmle.label | buff5 |
4835
| test.cpp:96:37:96:46 | theZipcode | semmle.label | theZipcode |
4936
| test.cpp:96:37:96:46 | theZipcode | semmle.label | theZipcode |
@@ -60,30 +47,21 @@ subpaths
6047
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:57:9:57:18 | theZipcode | this source of private data. |
6148
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:57:9:57:18 | theZipcode | this source of private data. |
6249
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:57:9:57:18 | theZipcode | this source of private data. |
63-
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:57:9:57:18 | theZipcode | this source of private data. |
64-
| test.cpp:74:11:74:15 | buff1 | test.cpp:74:24:74:30 | medical | test.cpp:74:11:74:15 | buff1 | This write into the external location 'buff1' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
6550
| test.cpp:74:24:74:30 | medical | test.cpp:74:24:74:30 | medical | test.cpp:74:24:74:30 | medical | This write into the external location 'medical' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
66-
| test.cpp:78:11:78:15 | buff2 | test.cpp:74:24:74:30 | medical | test.cpp:78:11:78:15 | buff2 | This write into the external location 'buff2' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
67-
| test.cpp:78:11:78:15 | buff2 | test.cpp:77:16:77:22 | medical | test.cpp:78:11:78:15 | buff2 | This write into the external location 'buff2' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
6851
| test.cpp:78:24:78:27 | temp | test.cpp:74:24:74:30 | medical | test.cpp:78:24:78:27 | temp | This write into the external location 'temp' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
6952
| test.cpp:78:24:78:27 | temp | test.cpp:77:16:77:22 | medical | test.cpp:78:24:78:27 | temp | This write into the external location 'temp' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
70-
| test.cpp:82:11:82:15 | buff3 | test.cpp:74:24:74:30 | medical | test.cpp:82:11:82:15 | buff3 | This write into the external location 'buff3' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
71-
| test.cpp:82:11:82:15 | buff3 | test.cpp:77:16:77:22 | medical | test.cpp:82:11:82:15 | buff3 | This write into the external location 'buff3' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
72-
| test.cpp:82:11:82:15 | buff3 | test.cpp:81:22:81:28 | medical | test.cpp:82:11:82:15 | buff3 | This write into the external location 'buff3' may contain unencrypted data from $@. | test.cpp:81:22:81:28 | medical | this source of private data. |
7353
| test.cpp:82:24:82:28 | buff5 | test.cpp:74:24:74:30 | medical | test.cpp:82:24:82:28 | buff5 | This write into the external location 'buff5' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
7454
| test.cpp:82:24:82:28 | buff5 | test.cpp:77:16:77:22 | medical | test.cpp:82:24:82:28 | buff5 | This write into the external location 'buff5' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
7555
| test.cpp:82:24:82:28 | buff5 | test.cpp:81:22:81:28 | medical | test.cpp:82:24:82:28 | buff5 | This write into the external location 'buff5' may contain unencrypted data from $@. | test.cpp:81:22:81:28 | medical | this source of private data. |
7656
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
7757
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
7858
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
79-
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
8059
| test.cpp:99:42:99:51 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
8160
| test.cpp:99:42:99:51 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
8261
| test.cpp:99:42:99:51 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
8362
| test.cpp:99:42:99:51 | theZipcode | test.cpp:96:37:96:46 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:96:37:96:46 | theZipcode | this source of private data. |
8463
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:99:42:99:51 | theZipcode | this source of private data. |
8564
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:99:42:99:51 | theZipcode | this source of private data. |
8665
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:99:42:99:51 | theZipcode | this source of private data. |
87-
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:99:42:99:51 | theZipcode | this source of private data. |
8866
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:61:99:70 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:99:61:99:70 | theZipcode | this source of private data. |
8967
| test.cpp:99:42:99:51 | theZipcode | test.cpp:99:61:99:70 | theZipcode | test.cpp:99:42:99:51 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:99:61:99:70 | theZipcode | this source of private data. |
Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
11
edges
22
| tests.cpp:26:15:26:23 | badSource indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
3-
| tests.cpp:26:32:26:35 | data | tests.cpp:26:15:26:23 | badSource indirection |
4-
| tests.cpp:26:32:26:35 | data | tests.cpp:38:25:38:36 | strncat output argument |
53
| tests.cpp:26:32:26:35 | data indirection | tests.cpp:26:15:26:23 | badSource indirection |
64
| tests.cpp:26:32:26:35 | data indirection | tests.cpp:38:25:38:36 | strncat output argument |
75
| tests.cpp:33:34:33:39 | call to getenv indirection | tests.cpp:38:39:38:49 | environment indirection |
86
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:26:15:26:23 | badSource indirection |
97
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:26:15:26:23 | badSource indirection |
10-
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:26:15:26:23 | badSource indirection |
118
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:51:22:51:25 | badSource output argument |
129
| tests.cpp:38:39:38:49 | environment indirection | tests.cpp:38:25:38:36 | strncat output argument |
1310
| tests.cpp:51:12:51:20 | call to badSource indirection | tests.cpp:53:16:53:19 | data indirection |
14-
| tests.cpp:51:22:51:25 | badSource output argument | tests.cpp:51:22:51:25 | data |
1511
| tests.cpp:51:22:51:25 | badSource output argument | tests.cpp:51:22:51:25 | data indirection |
16-
| tests.cpp:51:22:51:25 | data | tests.cpp:26:32:26:35 | data |
17-
| tests.cpp:51:22:51:25 | data | tests.cpp:51:12:51:20 | call to badSource indirection |
18-
| tests.cpp:51:22:51:25 | data | tests.cpp:51:22:51:25 | badSource output argument |
1912
| tests.cpp:51:22:51:25 | data indirection | tests.cpp:26:32:26:35 | data indirection |
2013
| tests.cpp:51:22:51:25 | data indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
2114
nodes
2215
| tests.cpp:26:15:26:23 | badSource indirection | semmle.label | badSource indirection |
2316
| tests.cpp:26:15:26:23 | badSource indirection | semmle.label | badSource indirection |
24-
| tests.cpp:26:15:26:23 | badSource indirection | semmle.label | badSource indirection |
25-
| tests.cpp:26:32:26:35 | data | semmle.label | data |
2617
| tests.cpp:26:32:26:35 | data indirection | semmle.label | data indirection |
2718
| tests.cpp:33:34:33:39 | call to getenv indirection | semmle.label | call to getenv indirection |
2819
| tests.cpp:38:25:38:36 | strncat output argument | semmle.label | strncat output argument |
2920
| tests.cpp:38:25:38:36 | strncat output argument | semmle.label | strncat output argument |
30-
| tests.cpp:38:25:38:36 | strncat output argument | semmle.label | strncat output argument |
3121
| tests.cpp:38:39:38:49 | environment indirection | semmle.label | environment indirection |
3222
| tests.cpp:51:12:51:20 | call to badSource indirection | semmle.label | call to badSource indirection |
3323
| tests.cpp:51:22:51:25 | badSource output argument | semmle.label | badSource output argument |
34-
| tests.cpp:51:22:51:25 | data | semmle.label | data |
3524
| tests.cpp:51:22:51:25 | data indirection | semmle.label | data indirection |
3625
| tests.cpp:53:16:53:19 | data indirection | semmle.label | data indirection |
3726
subpaths
38-
| tests.cpp:51:22:51:25 | data | tests.cpp:26:32:26:35 | data | tests.cpp:26:15:26:23 | badSource indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
39-
| tests.cpp:51:22:51:25 | data | tests.cpp:26:32:26:35 | data | tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:51:22:51:25 | badSource output argument |
4027
| tests.cpp:51:22:51:25 | data indirection | tests.cpp:26:32:26:35 | data indirection | tests.cpp:26:15:26:23 | badSource indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
4128
#select
4229
| tests.cpp:53:16:53:19 | data | tests.cpp:33:34:33:39 | call to getenv indirection | tests.cpp:53:16:53:19 | data indirection | This argument to an OS command is derived from $@, dangerously concatenated into $@, and then passed to system(string). | tests.cpp:33:34:33:39 | call to getenv indirection | user input (an environment variable) | tests.cpp:38:25:38:36 | strncat output argument | strncat output argument |

0 commit comments

Comments
 (0)