diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-12-07 00:10:15 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-12-07 00:44:14 -0500 |
commit | 9eba69df1cd37c564e414165fd6e6314543427d9 (patch) | |
tree | edf0e577261e4bfb64fd4fc61f5c6df7a40584c9 /src/udev/udev-event.c | |
parent | 90b33a2746ef9a409e5b70ea6ef363941c671c1d (diff) |
udev: fix NULL deref when executing rules
We quite obviously check whether event->dev_db is nonnull, and
right after that call a function which asserts the same. Move
the call under the same if.
https://bugzilla.redhat.com/show_bug.cgi?id=1283971
Diffstat (limited to 'src/udev/udev-event.c')
-rw-r--r-- | src/udev/udev-event.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 2ef8bfe59e..8d601c9c2c 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -848,11 +848,11 @@ void udev_event_execute_rules(struct udev_event *event, /* disable watch during event processing */ if (major(udev_device_get_devnum(dev)) != 0) udev_watch_end(event->udev, event->dev_db); - } - if (major(udev_device_get_devnum(dev)) == 0 && - streq(udev_device_get_action(dev), "move")) - udev_device_copy_properties(dev, event->dev_db); + if (major(udev_device_get_devnum(dev)) == 0 && + streq(udev_device_get_action(dev), "move")) + udev_device_copy_properties(dev, event->dev_db); + } udev_rules_apply_to_event(rules, event, timeout_usec, timeout_warn_usec, |