mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
CPP: Add a test of ODASA-3654.
This commit is contained in:
@@ -6,3 +6,4 @@
|
||||
| test.c:15:2:15:7 | call to printf | Format expects 3 arguments but given 2 |
|
||||
| test.c:19:2:19:7 | call to printf | Format expects 2 arguments but given 1 |
|
||||
| test.c:29:3:29:8 | call to printf | Format expects 2 arguments but given 1 |
|
||||
| test.c:44:2:44:7 | call to printf | Format expects 3 arguments but given 2 |
|
||||
|
||||
@@ -40,4 +40,6 @@ void test(int i, const char *str)
|
||||
printf("%2$.*4$f", 0, num, 0, precision); // GOOD [FALSE POSITIVE]
|
||||
printf("%2$.*4$f", num, 0, precision); // BAD (too few format arguments) [INCORRECT MESSAGE]
|
||||
}
|
||||
|
||||
printf("%@ %i %i", 1, 2); // GOOD [FALSE POSITIVE]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user