diff options
author | Chris Michael <cp.michael@samsung.com> | 2013-11-18 12:37:38 +0000 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2013-11-18 12:37:38 +0000 |
commit | 7575883a56e0179c03fbfdbf8f49c406488b487d (patch) | |
tree | 2e0b4896d0543e887d563c56bf7970ece855675f /src/bin/eet | |
parent | 41a700b2d51d65e8a6b5b6490aac08e059a9038c (diff) |
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.c | 7 |
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, | |||
328 | 328 | ||
329 | fseek(f, 0, SEEK_END); | 329 | fseek(f, 0, SEEK_END); |
330 | textlen = ftell(f); | 330 | textlen = ftell(f); |
331 | if (textlen < 0) | ||
332 | { | ||
333 | ERR("cannot obtain current file position %s", out); | ||
334 | fclose(f); | ||
335 | exit(-1); | ||
336 | } | ||
337 | |||
331 | rewind(f); | 338 | rewind(f); |
332 | text = malloc(textlen); | 339 | text = malloc(textlen); |
333 | if (!text) | 340 | if (!text) |