]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: fix possible NULL dereference in discover_boot_entry
authorSam Leonard <sam.leonard@codethink.co.uk>
Thu, 15 Feb 2024 18:16:17 +0000 (18:16 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 16 Feb 2024 11:45:08 +0000 (12:45 +0100)
src/vmspawn/vmspawn.c

index dc796e5bbf1eae49f83cd7ffcf4b687d5806b82a..f3e2d1f6decf40b4d5e57a5326da0a0d14ee626d 100644 (file)
@@ -851,7 +851,7 @@ static int discover_boot_entry(const char *root, char **ret_linux, char ***ret_i
 
         const BootEntry *boot_entry = boot_config_default_entry(&config);
 
-        if (!IN_SET(boot_entry->type, BOOT_ENTRY_UNIFIED, BOOT_ENTRY_CONF))
+        if (boot_entry && !IN_SET(boot_entry->type, BOOT_ENTRY_UNIFIED, BOOT_ENTRY_CONF))
                 boot_entry = NULL;
 
         /* If we cannot determine a default entry search for UKIs (Type #2 EFI Unified Kernel Images)