Re: tg3_read_partno(): possible array overrun

2006-11-07 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]> Date: Mon, 06 Nov 2006 12:07:31 -0800 > On Mon, 2006-11-06 at 10:45 +0100, Adrian Bunk wrote: > > The Coverity checker noted the following in drivers/net/tg3.c: > > > > <-- snip --> > > > > The problem is that vpd_data[i + 2] could be vpd_data[255 + 2].

Re: tg3_read_partno(): possible array overrun

2006-11-06 Thread Michael Chan
On Mon, 2006-11-06 at 10:45 +0100, Adrian Bunk wrote: > The Coverity checker noted the following in drivers/net/tg3.c: > > <-- snip --> > > The problem is that vpd_data[i + 2] could be vpd_data[255 + 2]. Thanks. This should fix it: [TG3]: Fix array overrun in tg3_read_partno(). Use proper u

tg3_read_partno(): possible array overrun

2006-11-06 Thread Adrian Bunk
The Coverity checker noted the following in drivers/net/tg3.c: <-- snip --> ... static void __devinit tg3_read_partno(struct tg3 *tp) { unsigned char vpd_data[256]; int i; ... /* Now parse and find the part number. */ for (i = 0; i < 256; ) { unsi