diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/usb/bus.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c index ca329be..53c85fe 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -47,7 +47,9 @@ static int usb_device_post_load(void *opaque, int version_id) } else { dev->attached = 1; } - if (dev->setup_index >= sizeof(dev->data_buf) || + if (dev->setup_index < 0 || + dev->setup_len < 0 || + dev->setup_index >= sizeof(dev->data_buf) || dev->setup_len >= sizeof(dev->data_buf)) { return -EINVAL; } |