3 #include "smatch_extra.h"
7 static void match_printf(const char *fn
, struct expression
*expr
, void *unused
)
9 struct expression
*format
;
11 format
= get_argument_from_call_expr(expr
->args
, 0);
12 if (format
-> type
!= EXPR_STRING
)
13 sm_msg("warn: format strings should be constant to avoid format string vulnerabilities");
16 void check_format_string(int id
)
21 add_function_hook("printf", &match_printf
, (void *)0);