diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-15 18:46:23 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-15 15:50:27 +0100 |
commit | a6da77b71bd3a86f4b24d535b58f57ba83f5669d (patch) | |
tree | 17a4fcbb77048c832572eedb9fa75ef0c0601373 /src/udev | |
parent | 28f38a76345b7548700d2337dd8b9a8c3f5b0643 (diff) | |
download | systemd-a6da77b71bd3a86f4b24d535b58f57ba83f5669d.tar.gz systemd-a6da77b71bd3a86f4b24d535b58f57ba83f5669d.tar.bz2 systemd-a6da77b71bd3a86f4b24d535b58f57ba83f5669d.zip |
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.
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-rules.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index dcde65c8ef..c52f93af1c 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -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; |