From: Victor Westerhuis Date: Sun, 14 Nov 2021 15:26:03 +0000 (+0100) Subject: Do not require a valid version when parsing sd-boot loader entries X-Git-Tag: v252-rc1~943 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87c7779599ade84df7934c563adb7fe550c871f7;p=thirdparty%2Fsystemd.git Do not require a valid version when parsing sd-boot loader entries This fixes #20820 --- diff --git a/src/fundamental/bootspec-fundamental.c b/src/fundamental/bootspec-fundamental.c index 89e29f59828..c0138926a58 100644 --- a/src/fundamental/bootspec-fundamental.c +++ b/src/fundamental/bootspec-fundamental.c @@ -46,7 +46,7 @@ sd_bool bootspec_pick_name_version_sort_key( good_version = os_image_version ?: (os_version ?: (os_version_id ? : os_build_id)); good_sort_key = os_image_id ?: os_id; - if (!good_name || !good_version) + if (!good_name) return sd_false; if (ret_name) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 09eb36eb56c..123db595753 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -530,9 +530,11 @@ static int boot_entry_load_unified( if (!tmp.sort_key) return log_oom(); - tmp.version = strdup(good_version); - if (!tmp.version) - return log_oom(); + if (good_version) { + tmp.version = strdup(good_version); + if (!tmp.version) + return log_oom(); + } *ret = tmp; tmp = (BootEntry) {};