projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94c2b6a
)
usb: sanity check setup_index+setup_len in post_load
author
Gerd Hoffmann
<kraxel@redhat.com>
Wed, 28 Aug 2013 15:09:30 +0000
(17:09 +0200)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 10 Sep 2013 09:14:41 +0000
(11:14 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/bus.c
patch
|
blob
|
history
diff --git
a/hw/usb/bus.c
b/hw/usb/bus.c
index 82ca6a13e8ee788c3ddde0a82adcc183796cfc6f..72d5b9222529e284daa971eb02ad5906f6272e6a 100644
(file)
--- 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;
}