From 83fa2a9482a263f59e6f0b4d9181e2f1629bc876 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 11 May 2014 23:43:36 +0100 Subject: check return from fseek (fixes coverity 1109841) --- utils/container.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'utils/container.c') 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; -- cgit v1.2.3