summaryrefslogtreecommitdiff
path: root/src/bin/eet
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-11-18 12:37:38 +0000
committerChris Michael <cp.michael@samsung.com>2013-11-18 12:37:38 +0000
commit7575883a56e0179c03fbfdbf8f49c406488b487d (patch)
tree2e0b4896d0543e887d563c56bf7970ece855675f /src/bin/eet
parent41a700b2d51d65e8a6b5b6490aac08e059a9038c (diff)
downloadefl-7575883a56e0179c03fbfdbf8f49c406488b487d.tar.gz
ftell can return -1 to indicate error, so trap for that
Fixes Coverity CID1039358 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/bin/eet')
-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 c2f0338756..05ad423916 100644
--- a/src/bin/eet/eet_main.c
+++ b/src/bin/eet/eet_main.c
@@ -328,6 +328,13 @@ do_eet_encode(const char *file,
fseek(f, 0, SEEK_END);
textlen = ftell(f);
+ if (textlen < 0)
+ {
+ ERR("cannot obtain current file position %s", out);
+ fclose(f);
+ exit(-1);
+ }
+
rewind(f);
text = malloc(textlen);
if (!text)