mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: util/broadcom: Check return value of stat()
Change-Id: Ib53408e8b186c07aa8e42c67131d39c4add05983 Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Found-by: Coverity Scan #1323515 Original-Reviewed-on: https://review.coreboot.org/17881 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Martin Roth <martinroth@google.com> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/421215 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
parent
33b86a139c
commit
07f561c2cb
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue