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:
Yu Watanabe
2021-04-30 19:21:18 +09:00
parent fe7323815d
commit db2bad4368
+3
View File
@@ -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);
}