commit 499f62b1b9e3e6db6f9f77defdb0c2bb15c25778 parent 0ede11b6f9cd13ee8e1c01db78762705512e5316 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(-)
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);