]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-boot: don't dereference NULL ptr if loaded_image_path is NULL
authorLennart Poettering <lennart@poettering.net>
Fri, 8 Feb 2019 12:03:26 +0000 (13:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 11:41:32 +0000 (12:41 +0100)
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

index 909e4b0e62f5aaa1df52a5baff24588a6de3ab16..35c649fde6a4e49824907c6c88173b2f5ad8b5f9 100644 (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;
                         }