Skip to content

Commit 655fa53

Browse files
authored
Merge pull request github#17848 from jketema/wrong-format
C++: Add wrong format type builtin function test
2 parents fa4cc83 + ccc2a39 commit 655fa53

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| tests.c:3:74:3:74 | 1 | This format specifier for type 'char *' does not match the argument type 'int'. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Likely Bugs/Format/WrongTypeFormatArguments.ql
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
void f() {
2+
char buf[35];
3+
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 1), "%s", 1);
4+
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 1), "%d", 1);
5+
}

0 commit comments

Comments
 (0)