projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3167889
)
fuzz/libelf: return early if elf_init fails
author
Wei Liu
<wei.liu2@citrix.com>
Wed, 25 Jan 2017 11:14:42 +0000
(11:14 +0000)
committer
Wei Liu
<wei.liu2@citrix.com>
Thu, 26 Jan 2017 17:23:40 +0000
(17:23 +0000)
Coverity-ID:
1399557
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
tools/fuzz/libelf/libelf-fuzzer.c
patch
|
blob
|
history
diff --git
a/tools/fuzz/libelf/libelf-fuzzer.c
b/tools/fuzz/libelf/libelf-fuzzer.c
index 71561d346060f45f0c5a56fb1489cbc7f00d322d..1ba85717114a4dd68916244a1b58e4f2394a53eb 100644
(file)
--- a/
tools/fuzz/libelf/libelf-fuzzer.c
+++ b/
tools/fuzz/libelf/libelf-fuzzer.c
@@
-13,7
+13,9
@@
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
elf = &elf_buf;
memset(elf, 0, sizeof(*elf));
- elf_init(elf, (const char *)data, size);
+ if ( elf_init(elf, (const char *)data, size) < 0 )
+ return -1;
+
elf_parse_binary(elf);
elf_xen_parse(elf, &parms);