summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2016-12-15 15:02:09 +0100
committerPatrick Georgi <pgeorgi@google.com>2016-12-16 15:56:08 +0100
commita3e928cdf654b5e4923b0d51ada98969886205b8 (patch)
tree90b2ae84d0b02061aabca986a81706ca3340a501 /util
parent3d51a6ac992c1a1e68b37bdfe5c1fb8dffebf261 (diff)
downloadcoreboot-a3e928cdf654b5e4923b0d51ada98969886205b8.tar.xz
util/broadcom: Check return value of stat()
Change-Id: Ib53408e8b186c07aa8e42c67131d39c4add05983 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1323515 Reviewed-on: https://review.coreboot.org/17881 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'util')
-rw-r--r--util/broadcom/secimage/sbi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/broadcom/secimage/sbi.c b/util/broadcom/secimage/sbi.c
index 8718f14d34..d972ba4b07 100644
--- a/util/broadcom/secimage/sbi.c
+++ b/util/broadcom/secimage/sbi.c
@@ -109,7 +109,10 @@ int CreateSecureBootImage(int ac, char **av)
--ac, ++av;
}
- stat(bl, &file_stat);
+ if (stat(bl, &file_stat) == -1) {
+ puts("Can't stat bl");
+ return -1;
+ }
filesize = file_stat.st_size + MIN_SIZE;
buf = calloc(sizeof(uint8_t), filesize);