Skip to content

Commit

Permalink
udev-rules: fix possible assertion
Browse files Browse the repository at this point in the history
On 'remove' action, event->dev_db_clone is NULL. So, `IMPORT{db}` rule
on 'remove' action triggers assertion. This fixes the issue.
  • Loading branch information
yuwata authored and keszybz committed Nov 15, 2018
1 parent 28f38a7 commit a6da77b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/udev/udev-rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a6da77b

Please sign in to comment.