Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17877
-gerrit
commit 907a0f6bdcbb37fb452f35b5b0e7db954da6b427 Author: Patrick Georgi pgeorgi@chromium.org Date: Thu Dec 15 14:53:23 2016 +0100
util/broadcom: Check for successful file access
Change-Id: I5c77b3c5ea3fbc249a8c564a521c2c3c45e1c560 Signed-off-by: Patrick Georgi pgeorgi@chromium.org Found-by: Coverity Scan #1323510 --- util/broadcom/secimage/io.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/util/broadcom/secimage/io.c b/util/broadcom/secimage/io.c index d71065c..f5be50a 100644 --- a/util/broadcom/secimage/io.c +++ b/util/broadcom/secimage/io.c @@ -73,6 +73,11 @@ int DataRead(char *filename, uint8_t *buf, int *length) return -1; } len = FileSizeGet(file); + if (len < 0) { + printf("Unable to seek in file: %s\n", filename); + fclose(file); + return -1; + } if (len < *length) *length = len; else