[systemd-devel] [PATCH] libudev: enumerate: fix NULL-deref for subsystem-matches

Kay Sievers kay at vrfy.org
Wed Sep 4 10:58:18 PDT 2013


On Fri, Aug 30, 2013 at 3:50 PM, David Herrmann <dh.herrmann at gmail.com> wrote:
> udev_device_get_subsystem() may return NULL if no subsystem could be
> figured out by libudev. This might be due to OOM or if the device
> disconnected between the udev_device_new() call and
> udev_device_get_subsystem(). Therefore, we need to handle subsystem==NULL
> safely.

Yeah, seems we never handled that properly.

The lazy evaluation of properties can return NULL if the device is
removed between creating it and asking for the values.

> Instead of testing for it in each helper, we treat subsystem==NULL as
> empty subsystem in match_subsystem().

Applied.

Thanks,
Kay


More information about the systemd-devel mailing list