ab0e4d
From cfa57e264efa138e99257fbfbe18449150a96c4d Mon Sep 17 00:00:00 2001
ab0e4d
From: Lukas Nykryn <lnykryn@redhat.com>
ab0e4d
Date: Thu, 14 Feb 2019 20:18:04 +0100
ab0e4d
Subject: [PATCH] install: string_hash_func should not be fed with NULL
ab0e4d
ab0e4d
If kmod_module_get_path returns NULL, we should skip that entry,
ab0e4d
the hash function does not like NULL pointers.
ab0e4d
ab0e4d
(cherry picked from commit fc141f22869bad2e5409d1cc555c1a42ea738343)
ab0e4d
ab0e4d
Resolves: #1868525
ab0e4d
---
ab0e4d
 install/dracut-install.c | 5 ++++-
ab0e4d
 1 file changed, 4 insertions(+), 1 deletion(-)
ab0e4d
ab0e4d
diff --git a/install/dracut-install.c b/install/dracut-install.c
ab0e4d
index 51f79422..f8ec9a59 100644
ab0e4d
--- a/install/dracut-install.c
ab0e4d
+++ b/install/dracut-install.c
ab0e4d
@@ -1248,6 +1248,9 @@ static int install_dependent_modules(struct kmod_list *modlist)
ab0e4d
                 mod = kmod_module_get_module(itr);
ab0e4d
                 path = kmod_module_get_path(mod);
ab0e4d
 
ab0e4d
+                if (path == NULL)
ab0e4d
+                        continue;
ab0e4d
+
ab0e4d
 		if (check_hashmap(items_failed, path))
ab0e4d
 			return -1;
ab0e4d
 
ab0e4d
@@ -1257,7 +1260,7 @@ static int install_dependent_modules(struct kmod_list *modlist)
ab0e4d
 
ab0e4d
                 name = kmod_module_get_name(mod);
ab0e4d
 
ab0e4d
-                if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
ab0e4d
+                if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
ab0e4d
                         continue;
ab0e4d
                 }
ab0e4d
 
ab0e4d