chiark / gitweb /
udev: usb_id: parse only 'size' bytes of the 'descriptors' buffer
authorKay Sievers <kay@vrfy.org>
Sun, 17 Feb 2013 20:16:56 +0000 (21:16 +0100)
committerKay Sievers <kay@vrfy.org>
Sun, 17 Feb 2013 20:16:56 +0000 (21:16 +0100)
src/udev/udev-builtin-usb_id.c

index ee83d4fde9ac44cf8772ade6e875e993f82ac61f..dcb2468bf6c67f34522e9037f7fd3c67d908bc07 100644 (file)
@@ -189,7 +189,7 @@ static int dev_if_packed_info(struct udev_device *dev, char *ifs_str, size_t len
         pos = 0;
         strpos = 0;
         ifs_str[0] = '\0';
-        while (pos < sizeof(buf) && strpos+7 < len-2) {
+        while (pos < size && strpos+7 < len-2) {
                 struct usb_interface_descriptor *desc;
                 char if_str[8];