From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56314 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PITxR-0003ys-82 for qemu-devel@nongnu.org; Tue, 16 Nov 2010 17:24:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PITxQ-000153-3q for qemu-devel@nongnu.org; Tue, 16 Nov 2010 17:24:57 -0500 Received: from mail-qy0-f180.google.com ([209.85.216.180]:47041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PITxQ-00014x-1d for qemu-devel@nongnu.org; Tue, 16 Nov 2010 17:24:56 -0500 Received: by qyk36 with SMTP id 36so1340451qyk.4 for ; Tue, 16 Nov 2010 14:24:55 -0800 (PST) Message-ID: <4CE304B9.6020206@codemonkey.ws> Date: Tue, 16 Nov 2010 16:24:57 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Out off array access in usb-net References: <20101109073653.GF9036@redhat.com> In-Reply-To: <20101109073653.GF9036@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org On 11/09/2010 01:36 AM, Gleb Natapov wrote: > Properly check array bounds before accessing array element. > > Signed-off-by: Gleb Natapov > Applied. Thanks. Regards, Anthony Liguori > diff --git a/hw/usb-net.c b/hw/usb-net.c > index 70f9263..84e2d79 100644 > --- a/hw/usb-net.c > +++ b/hw/usb-net.c > @@ -1142,7 +1142,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value, > break; > > default: > - if (usb_net_stringtable[value& 0xff]) { > + if (ARRAY_SIZE(usb_net_stringtable)> (value& 0xff)) { > ret = set_usb_string(data, > usb_net_stringtable[value& 0xff]); > break; > -- > Gleb. > > >