summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-11-18 11:58:39 +0000
committerChris Michael <cp.michael@samsung.com>2013-11-18 11:58:39 +0000
commit41a700b2d51d65e8a6b5b6490aac08e059a9038c (patch)
tree5965027a2f97f0240ca1614b3ba148e04339ffa9
parent164269a2dae3b15c37a319e43b5fc38d9bcd2038 (diff)
ftell can return -1 to indicate error, so trap for that.
Fixes Coverity CID1039356 Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/eet/eet_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bin/eet/eet_main.c b/src/bin/eet/eet_main.c
index e59c2599e..c2f033875 100644
--- a/src/bin/eet/eet_main.c
+++ b/src/bin/eet/eet_main.c
@@ -269,6 +269,13 @@ do_eet_insert(const char *file,
fseek(f, 0, SEEK_END);
size = ftell(f);
+ if (size < 0)
+ {
+ ERR("cannot obtain current file position %s", out);
+ fclose(f);
+ exit(-1);
+ }
+
rewind(f);
data = malloc(size);
if (!data)