summaryrefslogtreecommitdiffstats
path: root/hw/usb-net.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-11-09 09:36:53 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-11-16 14:35:00 -0600
commitd59f8ba938afd837182e666cce777dfb860559e4 (patch)
tree7d31de4a9f7da1d44506fd6327503ad360c0707d /hw/usb-net.c
parent43ae691e775707b854f9920797c81b6b298bde61 (diff)
downloadhqemu-d59f8ba938afd837182e666cce777dfb860559e4.zip
hqemu-d59f8ba938afd837182e666cce777dfb860559e4.tar.gz
Out off array access in usb-net
Properly check array bounds before accessing array element. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-net.c')
-rw-r--r--hw/usb-net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb-net.c b/hw/usb-net.c
index 70f9263..58c672f 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;
OpenPOWER on IntegriCloud