diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-05-11 23:43:36 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-05-11 23:43:36 +0100 |
commit | 83fa2a9482a263f59e6f0b4d9181e2f1629bc876 (patch) | |
tree | 3f17a02056e615f347316ef09474ed9796c72392 /utils/container.c | |
parent | f94bc67107c9ab1f5816a442a664b0528c735b75 (diff) | |
download | netsurf-83fa2a9482a263f59e6f0b4d9181e2f1629bc876.tar.gz netsurf-83fa2a9482a263f59e6f0b4d9181e2f1629bc876.tar.bz2 |
check return from fseek (fixes coverity 1109841)
Diffstat (limited to 'utils/container.c')
-rw-r--r-- | utils/container.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/container.c b/utils/container.c index adf72b78e..3e03e15f1 100644 --- a/utils/container.c +++ b/utils/container.c @@ -89,10 +89,16 @@ inline static size_t container_filelen(FILE *fd) return 0; } - fseek(fd, 0, SEEK_END); + if (fseek(fd, 0, SEEK_END) != 0) { + LOG(("Could not get seek to end of file")); + return 0; + } a = ftell(fd); - fseek(fd, o, SEEK_SET); + if (fseek(fd, o, SEEK_SET) != 0) { + LOG(("Could not reset seek position in file")); + return 0; + } if (a == -1) { LOG(("could not ascertain size of file in theme container; omitting")); return 0; |