unconstant_macros: add VM_SOFTDIRTY
[smatch.git] / check_format_string.c
blob17783c2fd11a5d2d12caf09092ad4cf4eed1026f
1 #include <string.h>
2 #include "smatch.h"
3 #include "smatch_extra.h"
5 static int my_id;
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)
18 if (!option_spammy)
19 return;
20 my_id = id;
21 add_function_hook("printf", &match_printf, (void *)0);