mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-22 15:03:34 +07:00
Fix NULL pointer deference in udev_hwdb_get_properties_list_entry
It is possible for udev_hwdb_get_properties_list_entry to be invoked during udevd initialization before hwdb has been initialized. We workaround that for now by introducing a check to handle that. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Commit-message-by: Richard Yao <ryao@gentoo.org>
This commit is contained in:
parent
bcc69ef934
commit
f74b77335b
@ -33,6 +33,9 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *modalias, bool
|
||||
struct udev_list_entry *entry;
|
||||
int n = 0;
|
||||
|
||||
if (!hwdb)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, modalias, 0)) {
|
||||
if (udev_builtin_add_property(dev, test,
|
||||
udev_list_entry_get_name(entry),
|
||||
|
Loading…
Reference in New Issue
Block a user