[systemd-bugs] [Bug 58289] New: [PATCH] Check arguments to udev_enumerate_new

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Dec 14 06:01:24 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=58289

          Priority: medium
            Bug ID: 58289
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: [PATCH] Check arguments to udev_enumerate_new
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: michael.terry at canonical.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

udev_enumerate_new() does not check its input argument of a 'struct udev' for
NULLness.

This means that arguably sloppy code like in Xorg:

    udev = udev_monitor_get_udev(udev_monitor);
    enumerate = udev_enumerate_new(udev);
    if (!enumerate)
        return;

Will have a valid (but unusable) enumerate object even if the 'udev' pointer
itself is NULL.

While the Xorg code should probably also check the 'udev' pointer, I think it
makes sense for libudev to not create/return a bogus enumerate object.  Plus,
the other functions in libudev are pretty good about validating their input, so
it would be consistent.

Patch coming.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20121214/b54f88a6/attachment.html>


More information about the systemd-bugs mailing list