summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-15 18:46:23 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-15 15:50:27 +0100
commita6da77b71bd3a86f4b24d535b58f57ba83f5669d (patch)
tree17a4fcbb77048c832572eedb9fa75ef0c0601373 /src/udev
parent28f38a76345b7548700d2337dd8b9a8c3f5b0643 (diff)
downloadsystemd-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.c3
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;