From: Eric S. Raymond Date: Thu, 27 Nov 2003 03:30:13 +0000 (+0000) Subject: Fix a potential overrun bug. X-Git-Tag: 2.3~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=39dc30593c8f7b392c77c91fac66bcd6e6711a3d;p=comparator.git Fix a potential overrun bug. Fix --- 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)