install: string_hash_func should not be fed with NULL

If kmod_module_get_path returns NULL, we should skip that entry,
the hash function does not like NULL pointers.
master
Lukas Nykryn 2019-02-14 20:18:04 +01:00 committed by Harald Hoyer
parent 0d08f43d71
commit fc141f2286
1 changed files with 4 additions and 1 deletions

View File

@ -1244,6 +1244,9 @@ static int install_dependent_modules(struct kmod_list *modlist)
mod = kmod_module_get_module(itr); mod = kmod_module_get_module(itr);
path = kmod_module_get_path(mod); path = kmod_module_get_path(mod);


if (path == NULL)
continue;

if (check_hashmap(items_failed, path)) if (check_hashmap(items_failed, path))
return -1; return -1;


@ -1253,7 +1256,7 @@ static int install_dependent_modules(struct kmod_list *modlist)


name = kmod_module_get_name(mod); name = kmod_module_get_name(mod);


if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) { if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
continue; continue;
} }