1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

bootctl: Fix NULL pointer dereference

Fixes: #25952
(cherry picked from commit 6e689dc6ee)
(cherry picked from commit 295bb34f9a)
This commit is contained in:
Jan Janssen 2023-01-06 09:26:04 +01:00 committed by Luca Boccassi
parent 640acfb459
commit b33fbceef9

View File

@ -526,9 +526,11 @@ static int boot_entry_load_unified(
if (!tmp.title) if (!tmp.title)
return log_oom(); return log_oom();
tmp.sort_key = strdup(good_sort_key); if (good_sort_key) {
if (!tmp.sort_key) tmp.sort_key = strdup(good_sort_key);
return log_oom(); if (!tmp.sort_key)
return log_oom();
}
tmp.version = strdup(good_version); tmp.version = strdup(good_version);
if (!tmp.version) if (!tmp.version)