From: Gleb Natapov <gleb@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Out off array access in usb-net
Date: Tue, 9 Nov 2010 09:36:53 +0200 [thread overview]
Message-ID: <20101109073653.GF9036@redhat.com> (raw)
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.
next reply other threads:[~2010-11-09 7:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 7:36 Gleb Natapov [this message]
2010-11-09 9:29 ` [Qemu-devel] Re: [PATCH] Out off array access in usb-net Paolo Bonzini
2010-11-09 9:30 ` [Qemu-devel] " 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=20101109073653.GF9036@redhat.com \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.