diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-11-09 09:36:53 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-11-16 14:35:00 -0600 |
commit | d59f8ba938afd837182e666cce777dfb860559e4 (patch) | |
tree | 7d31de4a9f7da1d44506fd6327503ad360c0707d /hw/usb-net.c | |
parent | 43ae691e775707b854f9920797c81b6b298bde61 (diff) |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb-net.c b/hw/usb-net.c index 70f9263291..58c672f426 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; |