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>
This commit is contained in:
parent
43ae691e77
commit
d59f8ba938
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user