UPSTREAM: util/cbfstool: Add NULL-ptr check

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323507
Reviewed-on: https://review.coreboot.org/17858
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>

Change-Id: I8b5caf5423135fe683a24db6700b895a2685cb98
Reviewed-on: https://chromium-review.googlesource.com/420519
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Patrick Georgi 2016-12-14 16:08:52 +01:00 committed by chrome-bot
parent 0e4272c74e
commit 06b470b633

View file

@ -175,6 +175,7 @@ static int cbfs_file_get_compression_info(struct cbfs_file *entry,
uint32_t *decompressed_size)
{
unsigned int compression = CBFS_COMPRESS_NONE;
if (decompressed_size)
*decompressed_size = ntohl(entry->len);
for (struct cbfs_file_attribute *attr = cbfs_file_first_attr(entry);
attr != NULL;