diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2014-11-08 23:14:09 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-11-10 10:03:39 +0100 |
commit | 024108eecd2ef03a843cf42e3d45c0db11e4fc75 (patch) | |
tree | 26c89c33065f73f6a30370bf78ffb5a2b8ce23ff | |
parent | 57f67537af9cdf34ae9edb76f351c7df277a55b4 (diff) | |
download | nvidia-cbootimage-024108eecd2ef03a843cf42e3d45c0db11e4fc75.tar.gz |
set: check seek success
This could silently fail which leads to surprising behaviour.
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | src/set.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -59,7 +59,11 @@ read_from_image(char *filename, return result; } - fseek(fp, offset, SEEK_SET); + if (fseek(fp, offset, SEEK_SET) == -1) { + printf("Error: Couldn't seek to %s(%d)\n", filename, offset); + result = 1; + goto cleanup; + } if (stat(filename, &stats) != 0) { printf("Error: Unable to query info on bootloader path %s\n", |