From: Yu Watanabe Date: Tue, 20 Sep 2022 01:47:14 +0000 (+0900) Subject: sd-device: refuse to get a parent device by sd_device_new_child() X-Git-Tag: v252-rc1~88^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10a2f90d02c484c7e1d8f3c69b46d954508e1a43;p=thirdparty%2Fsystemd.git sd-device: refuse to get a parent device by sd_device_new_child() --- diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 9364a69dcd0..ab96f889cb1 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -879,7 +879,7 @@ _public_ int sd_device_new_child(sd_device **ret, sd_device *device, const char assert_return(device, -EINVAL); assert_return(suffix, -EINVAL); - if (!path_is_normalized(suffix)) + if (!path_is_safe(suffix)) return -EINVAL; r = sd_device_get_syspath(device, &s);