mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
udev: Don't let strtoul parse USB busnum and devnum as octal
udevGetUintProperty was called with base set to 0 for busnum and devnum. With base 0 strtoul parses the number as octal if it start with a 0. But busnum and devnum are decimal and udev returns them padded with leading zeros. So strtoul parses them as octal. This works for certain decimal values like 001-007, but fails for values like 008. Change udevProcessUSBDevice to use base 10 for busnum and devnum.
This commit is contained in:
parent
c16888a849
commit
33e25a3984
@ -500,14 +500,14 @@ static int udevProcessUSBDevice(struct udev_device *device,
|
|||||||
if (udevGetUintProperty(device,
|
if (udevGetUintProperty(device,
|
||||||
"BUSNUM",
|
"BUSNUM",
|
||||||
&data->usb_dev.bus,
|
&data->usb_dev.bus,
|
||||||
0) == PROPERTY_ERROR) {
|
10) == PROPERTY_ERROR) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (udevGetUintProperty(device,
|
if (udevGetUintProperty(device,
|
||||||
"DEVNUM",
|
"DEVNUM",
|
||||||
&data->usb_dev.device,
|
&data->usb_dev.device,
|
||||||
0) == PROPERTY_ERROR) {
|
10) == PROPERTY_ERROR) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user