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]);
31 * check-name: smatch overflow check #4
32 * check-command: smatch sm_array_overflow4.c
35 sm_array_overflow4.c +22 main(14) error: buffer overflow 's' 8 <= 8
36 sm_array_overflow4.c +23 main(15) error: buffer overflow 's2' 8 <= 8
37 sm_array_overflow4.c +25 main(17) error: buffer overflow 'a' 8 <= 8
38 sm_array_overflow4.c +26 main(18) error: strcpy() "1234" too large for buf (5 vs 4)