diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-08-28 17:09:30 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-09-10 11:14:41 +0200 |
commit | c60174e847082ab9f70720f86509a3353f816fad (patch) | |
tree | a1090bdfffccfe8b0864282df7935c8ab7b1b1f3 /hw | |
parent | 94c2b6aff43cdfcfdfb552773a6b6b973a72ef0b (diff) |
usb: sanity check setup_index+setup_len in post_load
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/usb/bus.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 82ca6a13e8..72d5b92225 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -47,6 +47,10 @@ static int usb_device_post_load(void *opaque, int version_id) } else { dev->attached = 1; } + if (dev->setup_index >= sizeof(dev->data_buf) || + dev->setup_len >= sizeof(dev->data_buf)) { + return -EINVAL; + } return 0; } |