projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43ae691
)
Out off array access in usb-net
author
Gleb Natapov
<gleb@redhat.com>
Tue, 9 Nov 2010 07:36:53 +0000
(09:36 +0200)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Tue, 16 Nov 2010 20:35:00 +0000
(14:35 -0600)
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>
hw/usb-net.c
patch
|
blob
|
history
diff --git
a/hw/usb-net.c
b/hw/usb-net.c
index 70f9263291aa2b9cd8cadf816c7e515723ea71cd..58c672f426b6e57eac4e058d7bed7cdd55c425ba 100644
(file)
--- 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;