Skip to content

Commit f5d5460

Browse files
committed
C++: Fix testcase.
1 parent fa44ced commit f5d5460

File tree

1 file changed

+2
-2
lines changed
  • cpp/ql/test/query-tests/Security/CWE/CWE-079/semmle/CgiXss

1 file changed

+2
-2
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-079/semmle/CgiXss/search.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ void good_server1(char* query) {
3737
puts(do_search(query));
3838
}
3939

40-
int snprintf(char *, int, const char *, ...);
40+
int scanf(const char *, ...);
4141

4242
void good_server2(char* query) {
4343
puts("<p>Query results for ");
4444
// GOOD: Only an integer is added to the page.
4545
int i = 0;
46-
snprintf(query, 16, "value=%i", &i);
46+
sscanf(query, "value=%i", &i);
4747
printf("\n<p>%i</p>\n", i);
4848
}
4949

0 commit comments

Comments
 (0)