sd-boot: don't dereference NULL ptr if loaded_image_path is NULL

In a follow-up commit we'd like to invoke config_entry_add_from_file()
on partitions that are not the ESP, let's prepare fpr that and allow
loaded_image_path to be passed as NULL.
This commit is contained in:
Lennart Poettering 2019-02-08 13:03:26 +01:00
parent c8ad5996b0
commit 17ad0f0f4b

View file

@ -1316,7 +1316,7 @@ static VOID config_entry_add_from_file(
entry->loader = stra_to_path(value);
/* do not add an entry for ourselves */
if (StriCmp(entry->loader, loaded_image_path) == 0) {
if (loaded_image_path && StriCmp(entry->loader, loaded_image_path) == 0) {
entry->type = LOADER_UNDEFINED;
break;
}