repo.or.cz
/
smatch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
states: add another read_only check
[smatch.git]
/
validation
/
sm_overflow.c
blob
c4f33a87f6efcf14a502efa026bcddde3c24612d
1
struct
field
{
2
int
b
[
8
];
3
};
4
5
struct
buffer
{
6
struct
field a
;
7
int
x
;
8
};
9
10
int
main
(
int
argc
,
char
*
argv
[])
11
{
12
struct
buffer b1
;
13
int
i
;
14
15
b1
.
a
.
b
[
10
] =
1
;
16
17
return
42
;
18
}
19
20
/*
21
* check-name: Check array overflow
22
* check-command: smatch sm_overflow.c
23
*
24
* check-output-start
25
sm_overflow.c:15 main() error: buffer overflow 'b1.a.b' 8 <= 10
26
* check-output-end
27
*/