sd-device: make devpath check stricter

See assertion in sd_device_get_devpath().
This commit is contained in:
Yu Watanabe
2021-02-21 04:40:23 +09:00
parent 45e093a968
commit 9dcde1034c
+1 -1
View File
@@ -198,7 +198,7 @@ int device_set_syspath(sd_device *device, const char *_syspath, bool verify) {
devpath = syspath + STRLEN("/sys");
if (devpath[0] == '\0')
if (devpath[0] != '/')
/* '/sys' alone is not a valid device path */
return -ENODEV;