4 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
6 long long a
[] = {1, 2};
23 printf("%d\n", s2
[8]);
24 printf("%d\n", ((short *)a
)[6]);
25 printf("%d\n", ((short *)a
)[8]);
32 * check-name: smatch overflow check #4
33 * check-command: smatch --spammy sm_array_overflow4.c
36 sm_array_overflow4.c:22 main() error: buffer overflow 's' 8 <= 8
37 sm_array_overflow4.c:23 main() error: buffer overflow 's2' 8 <= 8
38 sm_array_overflow4.c:25 main() error: buffer overflow 'a' 8 <= 8
39 sm_array_overflow4.c:26 main() error: strcpy() '"1234"' too large for 'buf' (5 vs 4)
40 sm_array_overflow4.c:27 main() warn: strcpy() 'arg0' of unknown size might be too large for 'buf2'