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.
Created attachment 71499 [details] [review] Proposed patch
Applied. Thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.