From 2ba4b1107835087a0f994f83ca4b0ee22e1227da Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 17 Feb 2013 21:16:56 +0100 Subject: udev: usb_id: parse only 'size' bytes of the 'descriptors' buffer Signed-off-by: Anthony G. Basile --- src/udev/udev-builtin-usb_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c index e020f8198f..ce9ffe7db8 100644 --- a/src/udev/udev-builtin-usb_id.c +++ b/src/udev/udev-builtin-usb_id.c @@ -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]; -- cgit v1.2.3-54-g00ecf