summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-05-11 23:48:40 +0100
committerVincent Sanders <vince@kyllikki.org>2014-05-11 23:48:40 +0100
commit06091eee36f91e25bd3a914e54cc139e92db1c4c (patch)
treef469fa93f3d7153f72b711c0b75be45c8299bfc8 /utils
parentc3e2dc90057cc531a19aafcf65c5916dabceb2ef (diff)
downloadnetsurf-06091eee36f91e25bd3a914e54cc139e92db1c4c.tar.gz
netsurf-06091eee36f91e25bd3a914e54cc139e92db1c4c.tar.bz2
fix fseek error return checking (fixes coverity 1109839)
Diffstat (limited to 'utils')
-rw-r--r--utils/container.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/container.c b/utils/container.c
index 9ffe7f5c0..605237abe 100644
--- a/utils/container.c
+++ b/utils/container.c
@@ -195,12 +195,16 @@ static void container_process(struct container_ctx *ctx)
fileno(ctx->fh), 0);
#else
ctx->data = malloc(ctx->header.diroffset);
- fseek(ctx->fh, 0, SEEK_SET);
+ if (fseek(ctx->fh, 0, SEEK_SET) != 0) {
+ return;
+ }
val = fread(ctx->data, ctx->header.diroffset, 1, ctx->fh);
if (val == 0)
LOG(("empty read diroffset"));
#endif
- fseek(ctx->fh, ctx->header.diroffset, SEEK_SET);
+ if (fseek(ctx->fh, ctx->header.diroffset, SEEK_SET) != 0) {
+ return;
+ }
/* now work through the directory structure taking it apart into
* our structure */
#define BEREAD(x) do { val = fread(&(x), 4, 1, ctx->fh); if (val == 0)\