summaryrefslogtreecommitdiffstats
path: root/src/fpid.c
diff options
context:
space:
mode:
authorpancake <pancake@flubox>2008-12-19 19:39:27 +0100
committerpancake <pancake@flubox>2008-12-19 19:39:27 +0100
commita6ef73359c0e0537ebf83795ebacbbfaee2c9c28 (patch)
tree1db2cc7c531927be96c581e4077500918ad45ac4 /src/fpid.c
parent3a1053b29e5fb8109463259ee9dff3d8f4e4be5b (diff)
download0xFFFF-a6ef73359c0e0537ebf83795ebacbbfaee2c9c28.tar.bz2
* Apply security patches from Erik Hovland - Thanks!
Diffstat (limited to 'src/fpid.c')
-rw-r--r--src/fpid.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fpid.c b/src/fpid.c
index f36b758..7387855 100644
--- a/src/fpid.c
+++ b/src/fpid.c
@@ -37,7 +37,12 @@ long fpid_size(const char *filename)
{
long sz;
FILE *fd = fopen(filename, "r");
- fseek(fd, 0, SEEK_END);
+ if (fd == NULL)
+ return -1;
+ if (fseek(fd, 0, SEEK_END) != 0) {
+ fclose(fd);
+ return -1;
+ }
sz = ftell(fd);
fclose(fd);
return sz;