ChangeSet 1.1074.1.10, 2003/07/09 21:34:08-07:00, david-b@pacbell.net [PATCH] USB: usb_string(), don't use bogus ids This is the 2.4 version of that patch I just sent for 2.5, making sure usbcore doesn't use un-initialized memory for its language IDs. drivers/usb/usb.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Nru a/drivers/usb/usb.c b/drivers/usb/usb.c --- a/drivers/usb/usb.c Mon Jul 14 10:04:20 2003 +++ b/drivers/usb/usb.c Mon Jul 14 10:04:20 2003 @@ -2154,7 +2154,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;