From: Paolo Bonzini <pbonzini@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] Out off array access in usb-net
Date: Tue, 09 Nov 2010 10:29:54 +0100 [thread overview]
Message-ID: <4CD91492.6070404@redhat.com> (raw)
In-Reply-To: <20101109073653.GF9036@redhat.com>
On 11/09/2010 08:36 AM, Gleb Natapov wrote:
> Properly check array bounds before accessing array element.
>
> Signed-off-by: Gleb Natapov<gleb@redhat.com>
> 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.
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo
next prev parent reply other threads:[~2010-11-09 9:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 7:36 [Qemu-devel] [PATCH] Out off array access in usb-net Gleb Natapov
2010-11-09 9:29 ` Paolo Bonzini [this message]
2010-11-09 9:30 ` Markus Armbruster
2010-11-09 9:39 ` Gleb Natapov
2010-11-09 10:16 ` Markus Armbruster
2010-11-09 10:34 ` Gleb Natapov
2010-11-09 10:51 ` Markus Armbruster
2010-11-16 20:08 ` Anthony Liguori
2010-11-16 20:14 ` Gleb Natapov
2010-11-16 22:24 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CD91492.6070404@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).