[PATCH] Fix index checking in key.c

2002-01-09 Thread Simon Glover
Two separate bugs: 1. The index checks should use and not ||, or else they'll always be true. 2. The check in key_inc has an off-by-one error. Simon --- key.c.old Wed Jan 9 17:58:59 2002 +++ key.c Wed Jan 9 18:01:33 2002 @@ -225,7 +225,7 @@ INTVAL key_element_type(struct

Re: [PATCH] Fix index checking in key.c

2002-01-09 Thread Simon Glover
On Wed, 9 Jan 2002, Simon Glover wrote: Two separate bugs: 1. The index checks should use and not ||, or else they'll always be true. 2. The check in key_inc has an off-by-one error. Simon Better hold off on applying this patch; it makes test 5 in perlhash.t fail (and

Re: [PATCH] Fix index checking in key.c

2002-01-09 Thread Dan Sugalski
At 06:39 PM 1/9/2002 +, Simon Glover wrote: On Wed, 9 Jan 2002, Simon Glover wrote: Two separate bugs: 1. The index checks should use and not ||, or else they'll always be true. 2. The check in key_inc has an off-by-one error. Simon Better hold off on applying

Re: [PATCH] Fix index checking in key.c

2002-01-09 Thread Simon Glover
On Wed, 9 Jan 2002, Dan Sugalski wrote: At 06:39 PM 1/9/2002 +, Simon Glover wrote: On Wed, 9 Jan 2002, Simon Glover wrote: Two separate bugs: 1. The index checks should use and not ||, or else they'll always be true. 2. The check in key_inc has an off-by-one

Re: [PATCH] Fix index checking in key.c

2002-01-09 Thread Dan Sugalski
At 07:15 PM 1/9/2002 +, Simon Glover wrote: OK, I think I've got it this time. The previous patch uncovered a bug in perlhash.pmc; index is actually the offset of a particular key pair within the perlhash structure, so we need to ensure that key-size is bigger than index. This patch

Re: [PATCH] Fix index checking in key.c

2002-01-09 Thread Simon Glover
On Wed, 9 Jan 2002, Dan Sugalski wrote: At 07:15 PM 1/9/2002 +, Simon Glover wrote: OK, I think I've got it this time. The previous patch uncovered a bug in perlhash.pmc; index is actually the offset of a particular key pair within the perlhash structure, so we need to ensure

Re: [PATCH] Fix index checking in key.c [APPLIED]

2002-01-09 Thread Dan Sugalski
At 07:19 PM 1/9/2002 +, Simon Glover wrote: On Wed, 9 Jan 2002, Dan Sugalski wrote: At 07:15 PM 1/9/2002 +, Simon Glover wrote: OK, I think I've got it this time. The previous patch uncovered a bug in perlhash.pmc; index is actually the offset of a particular key pair