From 17ad0f0f4b1cbe3ab9a47b61fec1cc9b0c05fb94 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 8 Feb 2019 13:03:26 +0100 Subject: [PATCH] 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. --- src/boot/efi/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 909e4b0e62..35c649fde6 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -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; }