Prevent underflow in buzh_init() - dedup - deduplicating backup program
HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit 499f62b1b9e3e6db6f9f77defdb0c2bb15c25778
DIR parent 0ede11b6f9cd13ee8e1c01db78762705512e5316
HTML Author: z3bra <contactatz3bradotorg>
Date: Thu, 21 Feb 2019 14:08:20 +0100
Prevent underflow in buzh_init()
Diffstat:
M hash.c | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
---
DIR diff --git a/hash.c b/hash.c
@@ -54,6 +54,9 @@ buzh_init(uint8_t *buf, size_t size)
size_t i;
uint32_t fp;
+ if (!size)
+ return 0;
+
for (i = size - 1, fp = 0; i > 0; i--, buf++)
fp ^= ROTL(buz[*buf], i % 32);