hooks: introduce a pre_merge hook (similar to a merge hook)
[smatch.git] / validation / sm_overflow.c
blobc4f33a87f6efcf14a502efa026bcddde3c24612d
1 struct field {
2 int b[8];
3 };
5 struct buffer {
6 struct field a;
7 int x;
8 };
10 int main(int argc, char* argv[])
12 struct buffer b1;
13 int i;
15 b1.a.b[10] = 1;
17 return 42;
21 * check-name: Check array overflow
22 * check-command: smatch sm_overflow.c
24 * check-output-start
25 sm_overflow.c:15 main() error: buffer overflow 'b1.a.b' 8 <= 10
26 * check-output-end