Skip to content

Commit

Permalink
Merge pull request #17848 from jketema/wrong-format
Browse files Browse the repository at this point in the history
C++: Add wrong format type builtin function test
jketema authored Oct 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents fa4cc83 + ccc2a39 commit 655fa53
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| tests.c:3:74:3:74 | 1 | This format specifier for type 'char *' does not match the argument type 'int'. |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Likely Bugs/Format/WrongTypeFormatArguments.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void f() {
char buf[35];
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 1), "%s", 1);
__builtin___sprintf_chk(buf, 0, __builtin_object_size(buf, 1), "%d", 1);
}

0 comments on commit 655fa53

Please sign in to comment.