From d59f8ba938afd837182e666cce777dfb860559e4 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Tue, 9 Nov 2010 09:36:53 +0200 Subject: [PATCH] Out off array access in usb-net Properly check array bounds before accessing array element. Signed-off-by: Gleb Natapov Signed-off-by: Anthony Liguori --- hw/usb-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.11.4.GIT