diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2016-08-09 15:01:58 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-08-10 21:13:06 +0200 |
commit | 5de5458c2c65c47b731552bd1c97473f186ea877 (patch) | |
tree | 8dad32a8a243bdd2e8a212955aca95c9562724e8 /util/cbfstool/lzma/C | |
parent | 93ef3ffdf055763708e66ae94bf98d2d0ea29ee0 (diff) | |
download | coreboot-5de5458c2c65c47b731552bd1c97473f186ea877.tar.gz coreboot-5de5458c2c65c47b731552bd1c97473f186ea877.tar.bz2 coreboot-5de5458c2c65c47b731552bd1c97473f186ea877.zip |
util/cbfstool: Initialize elf_writer pointer to avoid crash
If some error happens in cbfs_payload_make_elf, the code jumps to "out",
and elf_writer_destroy(ew) is called. This may happen before an elf
writer is allocated.
To avoid accessing an uninitialized pointer, initialize ew to NULL;
elf_writer_destroy will perform no action in this case.
Change-Id: I5f1f9c4d37f2bdeaaeeca7a15720c7b4c963d953
Reported-By: Coverity Scan (1361475)
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/16124
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/cbfstool/lzma/C')
0 files changed, 0 insertions, 0 deletions