]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: guard missing Windows auto entry
authordongshengyuan <545258830@qq.com>
Tue, 14 Jul 2026 11:40:15 +0000 (19:40 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Jul 2026 16:26:46 +0000 (01:26 +0900)
config_add_entry_loader_auto() returns NULL when the Windows loader
is missing. With reboot-for-bitlocker enabled, the caller still
assigned e->call and could dereference NULL.

This can happen when reboot-for-bitlocker is enabled but the ESP does
not contain EFI/Microsoft/Boot/bootmgfw.efi.

Before:
  systemd-boot could dereference NULL while building the menu

Follow-up for: 661615a0afacee3545cde0a48286c0fef983f8fe.

src/boot/boot.c

index e62df180910a6cfaf8818a6aa8062573d7f4ca7c..2281246f9ba66310df0cc211cbd021945687a51e 100644 (file)
@@ -2292,7 +2292,7 @@ static void config_add_entry_windows(Config *config, EFI_HANDLE *device, EFI_FIL
                         title ?: u"Windows Boot Manager",
                         u"\\EFI\\Microsoft\\Boot\\bootmgfw.efi");
 
-        if (config->reboot_for_bitlocker)
+        if (e && config->reboot_for_bitlocker)
                 e->call = call_boot_windows_bitlocker;
 #endif
 }