From 39dc30593c8f7b392c77c91fac66bcd6e6711a3d Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 27 Nov 2003 03:30:13 +0000 Subject: [PATCH] Fix a potential overrun bug. Fix --- hash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hash.c b/hash.c index 9605686..d6d45ca 100644 --- a/hash.c +++ b/hash.c @@ -56,7 +56,7 @@ This was Ron Rivest's suggestion: > a random "salt", e.g. T[i,j] = MD5(salt||i||j); if the salt is > chosen at run time it would be essentially impossible even for > an adversary to game the system, since he won't know the salt. - + Other good material is at . ****************************************************************************/ @@ -80,7 +80,8 @@ void hash_update(unsigned char *buffer, const int len) unsigned char *p; for (p = buffer; *p; p++) - hstate ^= magicbits[*p][cind++ % sizeof(magicbits[0])]; + hstate ^= magicbits[*p][cind++ % sizeof(magicbits[0]) / + sizeof(magicbits[0][0])]; } void hash_complete(hashval_t *hp) -- 2.43.0