Skip to content

Commit afbeca0

Browse files
author
Robert Marsh
committed
C++: Accept test outputs
1 parent 95ed546 commit afbeca0

4 files changed

Lines changed: 40 additions & 17 deletions

File tree

cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/TaintedPath.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
WARNING: Unused predicate sinkInstructionNodes (C:/semmle/code/ql/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.ql:64,13-33)
2-
WARNING: Unused predicate sinkOperand (C:/semmle/code/ql/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.ql:70,13-24)
31
edges
42
| test.c:9:23:9:26 | argv | test.c:17:11:17:18 | Argument 0 indirection |
53
| test.c:9:23:9:26 | argv | test.c:17:11:17:18 | Argument 0 indirection |
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
11
edges
2-
| search.c:14:24:14:28 | *query | search.c:17:8:17:12 | (const char *)... |
3-
| search.c:14:24:14:28 | *query | search.c:17:8:17:12 | query |
42
| search.c:14:24:14:28 | query | search.c:17:8:17:12 | (const char *)... |
53
| search.c:14:24:14:28 | query | search.c:17:8:17:12 | query |
64
| search.c:14:24:14:28 | query | search.c:17:8:17:12 | query |
7-
| search.c:22:24:22:28 | *query | search.c:23:39:23:43 | query |
8-
| search.c:22:24:22:28 | *query | search.c:23:39:23:43 | query |
95
| search.c:22:24:22:28 | query | search.c:23:39:23:43 | query |
106
| search.c:22:24:22:28 | query | search.c:23:39:23:43 | query |
11-
| search.c:41:21:41:26 | call to getenv | search.c:14:24:14:28 | *query |
12-
| search.c:41:21:41:26 | call to getenv | search.c:14:24:14:28 | *query |
137
| search.c:41:21:41:26 | call to getenv | search.c:14:24:14:28 | query |
148
| search.c:41:21:41:26 | call to getenv | search.c:14:24:14:28 | query |
15-
| search.c:41:21:41:26 | call to getenv | search.c:22:24:22:28 | *query |
16-
| search.c:41:21:41:26 | call to getenv | search.c:22:24:22:28 | *query |
179
| search.c:41:21:41:26 | call to getenv | search.c:22:24:22:28 | query |
1810
| search.c:41:21:41:26 | call to getenv | search.c:22:24:22:28 | query |
1911
nodes
20-
| search.c:14:24:14:28 | *query | semmle.label | *query |
2112
| search.c:14:24:14:28 | query | semmle.label | query |
2213
| search.c:17:8:17:12 | (const char *)... | semmle.label | (const char *)... |
2314
| search.c:17:8:17:12 | (const char *)... | semmle.label | (const char *)... |
2415
| search.c:17:8:17:12 | query | semmle.label | query |
2516
| search.c:17:8:17:12 | query | semmle.label | query |
2617
| search.c:17:8:17:12 | query | semmle.label | query |
27-
| search.c:22:24:22:28 | *query | semmle.label | *query |
2818
| search.c:22:24:22:28 | query | semmle.label | query |
2919
| search.c:23:39:23:43 | query | semmle.label | query |
3020
| search.c:23:39:23:43 | query | semmle.label | query |
3121
| search.c:23:39:23:43 | query | semmle.label | query |
3222
| search.c:41:21:41:26 | call to getenv | semmle.label | call to getenv |
3323
| search.c:41:21:41:26 | call to getenv | semmle.label | call to getenv |
3424
| search.c:45:5:45:15 | Argument 0 | semmle.label | Argument 0 |
35-
| search.c:45:17:45:25 | Argument 0 indirection | semmle.label | Argument 0 indirection |
3625
| search.c:47:5:47:15 | Argument 0 | semmle.label | Argument 0 |
37-
| search.c:47:17:47:25 | Argument 0 indirection | semmle.label | Argument 0 indirection |
3826
#select
3927
| search.c:17:8:17:12 | query | search.c:41:21:41:26 | call to getenv | search.c:17:8:17:12 | query | Cross-site scripting vulnerability due to $@. | search.c:41:21:41:26 | call to getenv | this query data |
4028
| search.c:23:39:23:43 | query | search.c:41:21:41:26 | call to getenv | search.c:23:39:23:43 | query | Cross-site scripting vulnerability due to $@. | search.c:41:21:41:26 | call to getenv | this query data |

cpp/ql/test/query-tests/Security/CWE/CWE-120/semmle/tests/UnboundedWrite.expected

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,42 @@ edges
77
| tests.c:28:22:28:25 | argv | tests.c:28:22:28:28 | access to array |
88
| tests.c:28:22:28:25 | argv | tests.c:28:22:28:28 | access to array |
99
| tests.c:28:22:28:25 | argv | tests.c:28:22:28:28 | access to array |
10+
| tests.c:28:22:28:25 | argv | tests.c:31:15:31:23 | Argument 1 indirection |
11+
| tests.c:28:22:28:25 | argv | tests.c:31:15:31:23 | Argument 1 indirection |
12+
| tests.c:28:22:28:25 | argv | tests.c:31:15:31:23 | buffer100 |
13+
| tests.c:28:22:28:25 | argv | tests.c:31:15:31:23 | buffer100 |
14+
| tests.c:28:22:28:25 | argv | tests.c:33:21:33:29 | Argument 2 indirection |
15+
| tests.c:28:22:28:25 | argv | tests.c:33:21:33:29 | Argument 2 indirection |
16+
| tests.c:28:22:28:25 | argv | tests.c:33:21:33:29 | buffer100 |
17+
| tests.c:28:22:28:25 | argv | tests.c:33:21:33:29 | buffer100 |
1018
| tests.c:28:22:28:28 | access to array | tests.c:28:22:28:28 | (const char *)... |
1119
| tests.c:28:22:28:28 | access to array | tests.c:28:22:28:28 | access to array |
20+
| tests.c:28:22:28:28 | access to array | tests.c:31:15:31:23 | Argument 1 indirection |
21+
| tests.c:28:22:28:28 | access to array | tests.c:31:15:31:23 | buffer100 |
22+
| tests.c:28:22:28:28 | access to array | tests.c:33:21:33:29 | Argument 2 indirection |
23+
| tests.c:28:22:28:28 | access to array | tests.c:33:21:33:29 | buffer100 |
1224
| tests.c:29:28:29:31 | argv | tests.c:29:28:29:34 | access to array |
1325
| tests.c:29:28:29:31 | argv | tests.c:29:28:29:34 | access to array |
1426
| tests.c:29:28:29:31 | argv | tests.c:29:28:29:34 | access to array |
1527
| tests.c:29:28:29:31 | argv | tests.c:29:28:29:34 | access to array |
28+
| tests.c:29:28:29:31 | argv | tests.c:29:28:29:34 | access to array |
29+
| tests.c:29:28:29:31 | argv | tests.c:29:28:29:34 | access to array |
30+
| tests.c:29:28:29:31 | argv | tests.c:31:15:31:23 | Argument 1 indirection |
31+
| tests.c:29:28:29:31 | argv | tests.c:31:15:31:23 | Argument 1 indirection |
32+
| tests.c:29:28:29:31 | argv | tests.c:31:15:31:23 | buffer100 |
33+
| tests.c:29:28:29:31 | argv | tests.c:31:15:31:23 | buffer100 |
34+
| tests.c:29:28:29:31 | argv | tests.c:33:21:33:29 | Argument 2 indirection |
35+
| tests.c:29:28:29:31 | argv | tests.c:33:21:33:29 | Argument 2 indirection |
36+
| tests.c:29:28:29:31 | argv | tests.c:33:21:33:29 | buffer100 |
37+
| tests.c:29:28:29:31 | argv | tests.c:33:21:33:29 | buffer100 |
38+
| tests.c:29:28:29:34 | access to array | tests.c:31:15:31:23 | Argument 1 indirection |
39+
| tests.c:29:28:29:34 | access to array | tests.c:31:15:31:23 | buffer100 |
40+
| tests.c:29:28:29:34 | access to array | tests.c:33:21:33:29 | Argument 2 indirection |
41+
| tests.c:29:28:29:34 | access to array | tests.c:33:21:33:29 | buffer100 |
42+
| tests.c:31:15:31:23 | buffer100 | tests.c:33:21:33:29 | Argument 2 indirection |
43+
| tests.c:31:15:31:23 | buffer100 | tests.c:33:21:33:29 | buffer100 |
44+
| tests.c:31:15:31:23 | scanf output argument | tests.c:33:21:33:29 | Argument 2 indirection |
45+
| tests.c:31:15:31:23 | scanf output argument | tests.c:33:21:33:29 | buffer100 |
1646
| tests.c:34:10:34:13 | argv | tests.c:34:10:34:16 | (const char *)... |
1747
| tests.c:34:10:34:13 | argv | tests.c:34:10:34:16 | (const char *)... |
1848
| tests.c:34:10:34:13 | argv | tests.c:34:10:34:16 | access to array |
@@ -36,11 +66,16 @@ nodes
3666
| tests.c:29:28:29:34 | access to array | semmle.label | access to array |
3767
| tests.c:29:28:29:34 | access to array | semmle.label | access to array |
3868
| tests.c:29:28:29:34 | access to array | semmle.label | access to array |
69+
| tests.c:31:15:31:23 | Argument 1 indirection | semmle.label | Argument 1 indirection |
70+
| tests.c:31:15:31:23 | Argument 1 indirection | semmle.label | Argument 1 indirection |
3971
| tests.c:31:15:31:23 | array to pointer conversion | semmle.label | array to pointer conversion |
4072
| tests.c:31:15:31:23 | array to pointer conversion | semmle.label | array to pointer conversion |
4173
| tests.c:31:15:31:23 | buffer100 | semmle.label | buffer100 |
4274
| tests.c:31:15:31:23 | buffer100 | semmle.label | buffer100 |
4375
| tests.c:31:15:31:23 | buffer100 | semmle.label | buffer100 |
76+
| tests.c:31:15:31:23 | scanf output argument | semmle.label | scanf output argument |
77+
| tests.c:33:21:33:29 | Argument 2 indirection | semmle.label | Argument 2 indirection |
78+
| tests.c:33:21:33:29 | Argument 2 indirection | semmle.label | Argument 2 indirection |
4479
| tests.c:33:21:33:29 | array to pointer conversion | semmle.label | array to pointer conversion |
4580
| tests.c:33:21:33:29 | array to pointer conversion | semmle.label | array to pointer conversion |
4681
| tests.c:33:21:33:29 | buffer100 | semmle.label | buffer100 |
@@ -56,6 +91,11 @@ nodes
5691
#select
5792
| tests.c:28:3:28:9 | call to sprintf | tests.c:28:22:28:25 | argv | tests.c:28:22:28:28 | access to array | This 'call to sprintf' with input from $@ may overflow the destination. | tests.c:28:22:28:25 | argv | argv |
5893
| tests.c:29:3:29:9 | call to sprintf | tests.c:29:28:29:31 | argv | tests.c:29:28:29:34 | access to array | This 'call to sprintf' with input from $@ may overflow the destination. | tests.c:29:28:29:31 | argv | argv |
94+
| tests.c:31:15:31:23 | buffer100 | tests.c:28:22:28:25 | argv | tests.c:31:15:31:23 | buffer100 | This 'scanf string argument' with input from $@ may overflow the destination. | tests.c:28:22:28:25 | argv | argv |
95+
| tests.c:31:15:31:23 | buffer100 | tests.c:29:28:29:31 | argv | tests.c:31:15:31:23 | buffer100 | This 'scanf string argument' with input from $@ may overflow the destination. | tests.c:29:28:29:31 | argv | argv |
5996
| tests.c:31:15:31:23 | buffer100 | tests.c:31:15:31:23 | buffer100 | tests.c:31:15:31:23 | buffer100 | This 'scanf string argument' with input from $@ may overflow the destination. | tests.c:31:15:31:23 | buffer100 | buffer100 |
97+
| tests.c:33:21:33:29 | buffer100 | tests.c:28:22:28:25 | argv | tests.c:33:21:33:29 | buffer100 | This 'scanf string argument' with input from $@ may overflow the destination. | tests.c:28:22:28:25 | argv | argv |
98+
| tests.c:33:21:33:29 | buffer100 | tests.c:29:28:29:31 | argv | tests.c:33:21:33:29 | buffer100 | This 'scanf string argument' with input from $@ may overflow the destination. | tests.c:29:28:29:31 | argv | argv |
99+
| tests.c:33:21:33:29 | buffer100 | tests.c:31:15:31:23 | buffer100 | tests.c:33:21:33:29 | buffer100 | This 'scanf string argument' with input from $@ may overflow the destination. | tests.c:31:15:31:23 | buffer100 | buffer100 |
60100
| tests.c:33:21:33:29 | buffer100 | tests.c:33:21:33:29 | buffer100 | tests.c:33:21:33:29 | buffer100 | This 'scanf string argument' with input from $@ may overflow the destination. | tests.c:33:21:33:29 | buffer100 | buffer100 |
61101
| tests.c:34:25:34:33 | buffer100 | tests.c:34:10:34:13 | argv | tests.c:34:10:34:16 | access to array | This 'sscanf string argument' with input from $@ may overflow the destination. | tests.c:34:10:34:13 | argv | argv |

cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/globalVars/UncontrolledFormatStringThroughGlobalVar.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ edges
1717
| globalVars.c:12:2:12:15 | Store | globalVars.c:8:7:8:10 | copy |
1818
| globalVars.c:15:21:15:23 | val | globalVars.c:16:2:16:12 | Store |
1919
| globalVars.c:16:2:16:12 | Store | globalVars.c:9:7:9:11 | copy2 |
20-
| globalVars.c:24:11:24:14 | argv | globalVars.c:11:22:11:25 | *argv |
21-
| globalVars.c:24:11:24:14 | argv | globalVars.c:11:22:11:25 | *argv |
2220
| globalVars.c:24:11:24:14 | argv | globalVars.c:11:22:11:25 | argv |
2321
| globalVars.c:24:11:24:14 | argv | globalVars.c:11:22:11:25 | argv |
2422
| globalVars.c:27:9:27:12 | copy | globalVars.c:27:9:27:12 | (const char *)... |
@@ -36,7 +34,6 @@ nodes
3634
| globalVars.c:15:21:15:23 | val | semmle.label | val |
3735
| globalVars.c:16:2:16:12 | Store | semmle.label | Store |
3836
| globalVars.c:24:2:24:9 | Argument 0 | semmle.label | Argument 0 |
39-
| globalVars.c:24:11:24:14 | Argument 0 indirection | semmle.label | Argument 0 indirection |
4037
| globalVars.c:24:11:24:14 | argv | semmle.label | argv |
4138
| globalVars.c:24:11:24:14 | argv | semmle.label | argv |
4239
| globalVars.c:27:9:27:12 | (const char *)... | semmle.label | (const char *)... |

0 commit comments

Comments
 (0)