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
common_functions: add special handling of sprintf() and snprintf()
[smatch.git]
/
validation
/
sm_err_ptr.c
blob
d89f5d86d110c1c6c967cd521eaa275c248e867c
1
#include <stdio.h>
2
3
int
*
add_inode
();
4
int
IS_ERR
(
void
*);
5
6
int
main
(
void
)
7
{
8
int
*
p
;
9
10
p
=
add_inode
();
11
if
(!
IS_ERR
(
p
)) {
12
*
p
=
1
;
13
}
14
*
p
=
1
;
15
16
return
0
;
17
}
18
/*
19
* check-name: dereferencing ERR_PTR bugs
20
* check-command: smatch -p=kernel sm_err_ptr.c
21
*
22
* check-output-start
23
sm_err_ptr.c:14 main() error: 'p' dereferencing possible ERR_PTR()
24
* check-output-end
25
*/