1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

sd-device-monitor: actually refuse to send invalid devices

Fixes an issue introduced by 9e79123884a36ce095b98d1c0fe247dddf02dbec.

(cherry picked from commit 8bb4989906a1659b0f6adfa03dc7585e294a392b)
This commit is contained in:
Yu Watanabe 2022-08-12 04:19:27 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 81339c45e8
commit 6e1acfe818

View File

@ -578,8 +578,8 @@ int device_monitor_send_device(
if (r < 0)
return log_device_debug_errno(device, r, "sd-device-monitor: Failed to get device properties: %m");
if (blen < 32)
log_device_debug_errno(device, SYNTHETIC_ERRNO(EINVAL),
"sd-device-monitor: Length of device property nulstr is too small to contain valid device information");
return log_device_debug_errno(device, SYNTHETIC_ERRNO(EINVAL),
"sd-device-monitor: Length of device property nulstr is too small to contain valid device information");
/* fill in versioned header */
r = sd_device_get_subsystem(device, &val);