1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

Do not require a valid version when parsing sd-boot loader entries

This fixes #20820
This commit is contained in:
Victor Westerhuis 2021-11-14 16:26:03 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent a17ebc687b
commit 87c7779599
2 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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) {};