Re: [PATCH] powerpc: Read buffer overflow

2009-08-03 Thread Segher Boessenkool
The change seems unnecessary since we only compute the address of the element before the bounds check, we don't actually access the element. I believe that is legal in C. If you have an array a[N], taking &a[0] .. &a[N] are legal C, everything else is not. Segher

Re: [PATCH] powerpc: Read buffer overflow

2009-08-03 Thread Wolfram Sang
On Mon, Aug 03, 2009 at 10:57:17PM +1000, Paul Mackerras wrote: > Roel Kluin writes: > > > Check whether index is within bounds before grabbing the element. > > The change seems unnecessary since we only compute the address of the > element before the bounds check, we don't actually access the >

Re: [PATCH] powerpc: Read buffer overflow

2009-08-03 Thread Paul Mackerras
Roel Kluin writes: > Check whether index is within bounds before grabbing the element. The change seems unnecessary since we only compute the address of the element before the bounds check, we don't actually access the element. I believe that is legal in C. Paul. ___

[PATCH] powerpc: Read buffer overflow

2009-08-03 Thread Roel Kluin
Check whether index is within bounds before grabbing the element. Signed-off-by: Roel Kluin --- diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index a0f6838..588a5b0 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -294,10 +294,11 @