extra: remove a variable from match_comparison()
[smatch.git] / validation / sm_overflow5.c
blob1d39e6301537d77f3b7df3cde1d4f5b5a52d0cc6
1 #include "check_debug.h"
3 void memdup(char *to, int size);
4 void strcpy(char *dest, char *src);
6 void func (char *a, char *b)
8 char c[5];
10 a = memdup(b, 5);
11 strcpy(c, a);
12 a[5] = '\0';
15 * check-name: smatch memdup overflow
16 * check-command: smatch -I.. sm_overflow5.c
18 * check-output-start
19 sm_overflow5.c:12 func(6) error: buffer overflow 'a' 5 <= 5
20 * check-output-end