mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
udev-rules: use the right variable
We carefully prepare a copy of a local buffer to save in device cache
and then save the buffer there instead... This leads to abort in free()
on exit (also, copied is leaked).
Reproducer:
# udevadm test /sys/block/sr0
Follow-up-for: a9559ebcbc
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2406118
This commit is contained in:
committed by
Yu Watanabe
parent
fdb9ad1a44
commit
d23a7eb4c0
@@ -3026,7 +3026,7 @@ static int udev_rule_apply_token_to_event(
|
||||
if (!copied)
|
||||
return log_oom();
|
||||
|
||||
r = device_cache_sysattr_value(dev, resolved, value, /* error = */ 0);
|
||||
r = device_cache_sysattr_value(dev, resolved, copied, /* error = */ 0);
|
||||
if (r < 0)
|
||||
log_event_warning_errno(event, token, r, "Failed to cache sysfs attribute \"%s\", ignoring: %m", resolved);
|
||||
else if (r > 0) {
|
||||
|
||||
Reference in New Issue
Block a user