Re: drivers/net/at1700.c: at1700_probe1: array overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 25, 2005 at 10:42:11AM -0800, Roland Dreier wrote:
>     Adrian> This can result in indexing in an array with 8 entries the
>     Adrian> 10th entry.
> 
> Well, not really, since the first 8 entries of the array have every
> 3-bit pattern.  So pos3 & 0x07 will always match one of them.
> 
> I agree it would be cleaner to make the loop only go up to 7 though.

You either have this (impossible) overflow, or the case l_i == 7 isn't 
tested explicitely.

I'd say simply leave it as it is now.

But if noone disagrees, I'm inclined to add a comment.

>  - R.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux