From ec3d2f2e9d21891a8934adf75b5ee0683c130c95 Mon Sep 17 00:00:00 2001 From: Sam Leonard Date: Thu, 15 Feb 2024 18:16:17 +0000 Subject: [PATCH] vmspawn: fix possible NULL dereference in discover_boot_entry --- src/vmspawn/vmspawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index dc796e5bbf1..f3e2d1f6dec 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -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) -- 2.47.3