db: caller info needs to record the -1 parameters
[smatch.git] / validation / sm_overflow4.c
blob9af8346b86ec4bbf23f37d902ad78a8b24c9ee92
1 #include "check_debug.h"
3 void strndup(char *to, int size);
4 void strcpy(char *dest, char *src);
6 void func (char *a, char *b)
8 char c[5];
10 a = strndup(b, 5);
11 strcpy(c, a);
14 * check-name: smatch strndup overflow
15 * check-command: smatch -I.. sm_overflow4.c
17 * check-output-start
18 sm_overflow4.c +11 func(5) error: strcpy() 'a' too large for 'c' (6 vs 5)
19 * check-output-end