summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:15:12 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:15:12 +0100
commita87dd6095ce6a12b2d60439d16ba02b81cf6e0ef (patch)
tree8d1db5c43e3a8ad50302385bda88398b107405c1 /src
parentb26e8bc1618a31e9afd1d15b25cb8e766ab8e026 (diff)
src/file_pdf.c: check ftell returned value for error code
Diffstat (limited to 'src')
-rw-r--r--src/file_pdf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/file_pdf.c b/src/file_pdf.c
index 072a880..58c6136 100644
--- a/src/file_pdf.c
+++ b/src/file_pdf.c
@@ -92,6 +92,11 @@ static void file_rename_pdf(const char *old_filename)
return;
}
offset=ftell(handle);
+ if(offset < 0)
+ {
+ fclose(handle);
+ return;
+ }
offset=file_rsearch(handle, offset, pattern, sizeof(pattern));
if(offset==0)
{