ChangeSet 1.1372.2.6, 2003/07/09 20:52:04-07:00, [EMAIL PROTECTED]

[PATCH] USB: usb_get_string(), don't use bogus ids

This fixes a problem that's been around for some time:
usbcore will sometimes use un-initialized memory as if
it holds a valid language code.


 drivers/usb/core/message.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c
--- a/drivers/usb/core/message.c        Thu Jul 10 16:01:30 2003
+++ b/drivers/usb/core/message.c        Thu Jul 10 16:01:30 2003
@@ -986,7 +986,7 @@
                if (err < 0) {
                        err("error getting string descriptor 0 (error=%d)", err);
                        goto errout;
-               } else if (tbuf[0] < 4) {
+               } else if (err < 4 || tbuf[0] < 4) {
                        err("string descriptor 0 too short");
                        err = -EINVAL;
                        goto errout;



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to