Commit d59f8ba9 authored by Gleb Natapov's avatar Gleb Natapov Committed by Anthony Liguori
Browse files

Out off array access in usb-net



Properly check array bounds before accessing array element.

Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 43ae691e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;