From: Lennart Poettering Date: Fri, 8 Feb 2019 12:03:26 +0000 (+0100) Subject: sd-boot: don't dereference NULL ptr if loaded_image_path is NULL X-Git-Tag: v242-rc1~218^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17ad0f0f4b1cbe3ab9a47b61fec1cc9b0c05fb94;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 909e4b0e62f..35c649fde6a 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; }