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.

- Dave
--- 1.28/drivers/usb/core/message.c     Thu Jun 12 07:28:01 2003
+++ edited/drivers/usb/core/message.c   Mon Jul  7 15:24:11 2003
@@ -986,7 +990,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;

Reply via email to