projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0defb8
)
USB: gadget: Read buffer overflow
author
Roel Kluin
<roel.kluin@gmail.com>
Thu, 6 Aug 2009 23:09:51 +0000
(16:09 -0700)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Wed, 23 Sep 2009 13:46:32 +0000
(06:46 -0700)
Check whether index is within bounds before testing the element.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/composite.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/gadget/composite.c
b/drivers/usb/gadget/composite.c
index 59e85234fa0ad614cfb9a181d27007653c250a51..d05397ec8a183ebb4467b10f55fe9b67e1cce189 100644
(file)
--- a/
drivers/usb/gadget/composite.c
+++ b/
drivers/usb/gadget/composite.c
@@
-602,7
+602,7
@@
static int get_string(struct usb_composite_dev *cdev,
}
}
- for (len = 0;
s->wData[len] && len <= 126
; len++)
+ for (len = 0;
len <= 126 && s->wData[len]
; len++)
continue;
if (!len)
return -EINVAL;