diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-12-07 17:35:32 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2015-12-07 17:35:32 +0100 |
commit | 1941d19a5407ff9fecb6a6b02dfc8b3ca6de9bd8 (patch) | |
tree | edf0e577261e4bfb64fd4fc61f5c6df7a40584c9 /src | |
parent | 1fbcad80f0760976193303fcb5c88c8201c4f27e (diff) | |
parent | 9eba69df1cd37c564e414165fd6e6314543427d9 (diff) |
Merge pull request #2109 from keszybz/udev-null-deref
Udev null deref
Diffstat (limited to 'src')
-rw-r--r-- | src/libudev/libudev-device-private.c | 8 | ||||
-rw-r--r-- | src/udev/udev-event.c | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c index 2d3e62410c..2aae0726c1 100644 --- a/src/libudev/libudev-device-private.c +++ b/src/libudev/libudev-device-private.c @@ -137,14 +137,10 @@ gid_t udev_device_get_devnode_gid(struct udev_device *udev_device) { } void udev_device_ensure_usec_initialized(struct udev_device *udev_device, struct udev_device *udev_device_old) { - sd_device *device_old = NULL; - assert(udev_device); - if (udev_device_old) - device_old = udev_device_old->device; - - device_ensure_usec_initialized(udev_device->device, device_old); + device_ensure_usec_initialized(udev_device->device, + udev_device_old ? udev_device_old->device : NULL); } char **udev_device_get_properties_envp(struct udev_device *udev_device) { 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, |