summaryrefslogtreecommitdiffstats
path: root/src/hash.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/hash.c
parent3a1053b29e5fb8109463259ee9dff3d8f4e4be5b (diff)
download0xFFFF-a6ef73359c0e0537ebf83795ebacbbfaee2c9c28.tar.bz2
* Apply security patches from Erik Hovland - Thanks!
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index 77b4159..d4ad607 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -40,8 +40,10 @@ usho do_hash_file(const char *filename)
}
do { ret = fread(&buf, 1, BSIZE, fd);
- if (ret == -1)
+ if (ret == -1) {
+ fclose(fd);
return 0;
+ }
hash ^= do_hash((usho *)&buf, ret);
} while(ret);