1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

udev-rules: fix possible assertion

On 'remove' action, event->dev_db_clone is NULL. So, `IMPORT{db}` rule
on 'remove' action triggers assertion. This fixes the issue.
This commit is contained in:
Yu Watanabe 2018-11-15 18:46:23 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 28f38a7634
commit a6da77b71b

View File

@ -2043,7 +2043,8 @@ int udev_rules_apply_to_event(
const char *key;
key = rules_str(rules, cur->key.value_off);
if (sd_device_get_property_value(event->dev_db_clone, key, &val) >= 0)
if (event->dev_db_clone &&
sd_device_get_property_value(event->dev_db_clone, key, &val) >= 0)
device_add_property(dev, key, val);
else if (cur->key.op != OP_NOMATCH)
goto nomatch;