Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17881
-gerrit
commit 5c70592bdc4b1f41db4712df0f4cd4354156d58d Author: Patrick Georgi pgeorgi@chromium.org Date: Thu Dec 15 15:02:09 2016 +0100
util/broadcom: Check return value of stat()
Change-Id: Ib53408e8b186c07aa8e42c67131d39c4add05983 Signed-off-by: Patrick Georgi pgeorgi@chromium.org Found-by: Coverity Scan #1323515 --- util/broadcom/secimage/sbi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/util/broadcom/secimage/sbi.c b/util/broadcom/secimage/sbi.c index 8718f14..d972ba4 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);