sd-device: check the validity of device id
The device id is used as filename under /run/udev/data or /run/udev/watch.
This commit is contained in:
@@ -1306,6 +1306,9 @@ int device_get_device_id(sd_device *device, const char **ret) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (!filename_is_valid(id))
|
||||
return -EINVAL;
|
||||
|
||||
device->device_id = TAKE_PTR(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user