[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] usb: sanity check setup_index+setup_len in post
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 1/4] usb: sanity check setup_index+setup_len in post_load |
Date: |
Tue, 10 Sep 2013 11:41:10 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/bus.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 82ca6a1..72d5b92 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;
}
--
1.8.3.1