projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61c1117
)
usb-linux: Ensure devep != 0
author
Hans de Goede
<hdegoede@redhat.com>
Tue, 31 May 2011 09:35:22 +0000
(11:35 +0200)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 14 Jun 2011 10:56:49 +0000
(12:56 +0200)
So that we don't index endp_table with a negative index.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-linux.c
patch
|
blob
|
history
diff --git
a/usb-linux.c
b/usb-linux.c
index feb4d36d0bef320c12a5e3824b82b8b09dd6e2f0..2e0495e239a3fb8cc9bdd34985d6332c90ef0d47 100644
(file)
--- a/
usb-linux.c
+++ b/
usb-linux.c
@@
-1029,6
+1029,11
@@
static int usb_linux_update_endp_table(USBHostDevice *s)
}
devep = descriptors[i + 2];
+ if ((devep & 0x0f) == 0) {
+ fprintf(stderr, "usb-linux: invalid ep descriptor, ep == 0\n");
+ return 1;
+ }
+
switch (descriptors[i + 3] & 0x3) {
case 0x00:
type = USBDEVFS_URB_TYPE_CONTROL;