Skip to content

Commit 9f27194

Browse files
committed
C++: Adjust layout of the argvlocal test.
1 parent 285be28 commit 9f27194

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/argv/argvLocal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,14 @@ int main(int argc, char **argv) {
151151
printWrapper(i8);
152152

153153
// BAD: i9 value comes from argv
154+
154155
char *i9;
155156
memcpy(1 ? i9++ : 0, argv[1], 1);
156157
printf(i9);
157158
printWrapper(i9);
158159

159160
// BAD: i91 value comes from argv
161+
160162
char *i91;
161163
memcpy(0 ? 0 : (char *)((int) i91 * 2), argv[1], 1);
162164
printf(i91);

cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/argv/argvLocal.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
| argvLocal.c:136:15:136:18 | -- ... | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format) | argvLocal.c:115:13:115:16 | argv | argv |
1919
| argvLocal.c:144:9:144:10 | i7 | The value of this argument may come from $@ and is being used as a formatting argument to printf(format) | argvLocal.c:100:7:100:10 | argv | argv |
2020
| argvLocal.c:145:15:145:16 | i7 | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format) | argvLocal.c:100:7:100:10 | argv | argv |
21-
| argvLocal.c:167:18:167:20 | i10 | The value of this argument may come from $@ and is being used as a formatting argument to printf(format) | argvLocal.c:166:18:166:21 | argv | argv |
22-
| argvLocal.c:168:24:168:26 | i10 | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format) | argvLocal.c:166:18:166:21 | argv | argv |
21+
| argvLocal.c:169:18:169:20 | i10 | The value of this argument may come from $@ and is being used as a formatting argument to printf(format) | argvLocal.c:168:18:168:21 | argv | argv |
22+
| argvLocal.c:170:24:170:26 | i10 | The value of this argument may come from $@ and is being used as a formatting argument to printWrapper(correct), which calls printf(format) | argvLocal.c:168:18:168:21 | argv | argv |

0 commit comments

Comments
 (0)