[RFA] libiberty/hashtab.c, higher_prime_index: avoid array overrun

Dave Korn dave.korn.cygwin@gmail.com
Fri Mar 4 00:14:00 GMT 2011


On 03/03/2011 23:00, Mike Stump wrote:
> On Mar 3, 2011, at 2:26 PM, Michael Snyder wrote:
>> DJ Delorie wrote:
>>>> As written, the function will access element [30] of a 30-element array.
>>> Um, no?
>> Y-uh-huh!
> 
> fight fight fight...  :-)  There can be only one.

  I was just wondering whether now would be a good time to mention that having
prime-sized hash tables is only a workaround against the danger of someone
providing an inadequate hash function implementation in the first place?

    cheers,
      DaveK



More information about the Gdb-patches mailing list