From a6ef73359c0e0537ebf83795ebacbbfaee2c9c28 Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 19 Dec 2008 19:39:27 +0100 Subject: * Apply security patches from Erik Hovland - Thanks! --- src/hash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/hash.c') 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); -- cgit v1.2.3