1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-21 10:50:24 +03: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:
Matthias Bolte 2010-01-31 00:53:40 +01:00
parent c16888a849
commit 33e25a3984

View File

@ -500,14 +500,14 @@ static int udevProcessUSBDevice(struct udev_device *device,
if (udevGetUintProperty(device,
"BUSNUM",
&data->usb_dev.bus,
0) == PROPERTY_ERROR) {
10) == PROPERTY_ERROR) {
goto out;
}
if (udevGetUintProperty(device,
"DEVNUM",
&data->usb_dev.device,
0) == PROPERTY_ERROR) {
10) == PROPERTY_ERROR) {
goto out;
}