1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 20:25:25 +03:00

udev: usb_id: parse only 'size' bytes of the 'descriptors' buffer

This commit is contained in:
Kay Sievers 2013-02-17 21:16:56 +01:00
parent a2cbfd5916
commit 7962afbba9

View 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];