diff options
author | pancake <pancake@flubox> | 2008-12-19 19:39:27 +0100 |
---|---|---|
committer | pancake <pancake@flubox> | 2008-12-19 19:39:27 +0100 |
commit | a6ef73359c0e0537ebf83795ebacbbfaee2c9c28 (patch) | |
tree | 1db2cc7c531927be96c581e4077500918ad45ac4 /src/fpid.c | |
parent | 3a1053b29e5fb8109463259ee9dff3d8f4e4be5b (diff) | |
download | 0xFFFF-a6ef73359c0e0537ebf83795ebacbbfaee2c9c28.tar.bz2 |
* Apply security patches from Erik Hovland - Thanks!
Diffstat (limited to 'src/fpid.c')
-rw-r--r-- | src/fpid.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; |