fill_db_untrusted: follow untrusted data down the call tree
[smatch.git] / validation / sm_strlen.c
blob96390d8d65e0069fce51dc27891ca9a919abe6a5
1 int strlen(char *str);
2 int strcpy(char *str);
4 void func (char *input)
6 int input_len;
7 char buf[4];
9 input_len = strlen(input);
10 if (input_len <= 5) {
11 strcpy(buf, input);
13 if (input_len <= 3) {
14 strcpy(buf, input);
18 * check-name: Smatch strlen test
19 * check-command: smatch sm_strlen.c
21 * check-output-start
22 sm_strlen.c +11 func(7) error: strcpy() 'input' too large for 'buf' (6 vs 4)
23 * check-output-end