db: caller info needs to record the -1 parameters
[smatch.git] / validation / sm_strlen2.c
blobc319f0a5231c8d71faf80417c59966de8d76a1ac
1 int strlen(char *str);
2 int strcpy(char *str);
4 void func (char *input1, char *input2, char *input3)
6 char buf[4];
8 if (strlen(input1) > 4)
9 return;
10 strcpy(buf, input1);
12 if (10 > strlen(input2))
13 strcpy(buf, input2);
15 if (strlen(input3) <= 4)
16 strcpy(buf, input3);
19 * check-name: Smatch strlen test #2
20 * check-command: smatch sm_strlen2.c
22 * check-output-start
23 sm_strlen2.c +10 func(6) error: strcpy() 'input1' too large for 'buf' (5 vs 4)
24 sm_strlen2.c +13 func(9) error: strcpy() 'input2' too large for 'buf' (10 vs 4)
25 sm_strlen2.c +16 func(12) error: strcpy() 'input3' too large for 'buf' (5 vs 4)
26 * check-output-end