extra: remove a variable from match_comparison()
[smatch.git] / validation / sm_overflow4.c
blob432f288d87e25e67f46abc6cc88b9bbe8c1441c6
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