--- linux/drivers/usb/usb.c.orig 2002-09-30 21:12:23.000000000 +0200 +++ linux/drivers/usb/usb.c 2002-09-30 21:25:21.000000000 +0200 @@ -2121,7 +2121,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size) { unsigned char *tbuf; - int err; + int err, len; unsigned int u, idx; if (size <= 0 || !buf || !index) @@ -2151,10 +2151,15 @@ } /* - * Just ask for a maximum length string and then take the length - * that was returned. + * ask for the length of the string */ - err = usb_get_string(dev, dev->string_langid, index, tbuf, 255); + + err = usb_get_string(dev, dev->string_langid, index, tbuf, 2); + if(err<2) + goto errout; + len=tbuf[0]; + + err = usb_get_string(dev, dev->string_langid, index, tbuf, len); if (err < 0) goto errout;