]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: Fix NULL pointer dereference
authorJan Janssen <medhefgo@web.de>
Fri, 6 Jan 2023 08:26:04 +0000 (09:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 6 Jan 2023 09:39:41 +0000 (10:39 +0100)
Fixes: #25952
src/shared/bootspec.c

index 36a9f1d8bd252d9da4821a5ef93efa35717790e1..06f42ab61d70bb0d8cd51759134356456bb61200 100644 (file)
@@ -723,9 +723,11 @@ static int boot_entry_load_unified(
         if (!tmp.title)
                 return log_oom();
 
-        tmp.sort_key = strdup(good_sort_key);
-        if (!tmp.sort_key)
-                return log_oom();
+        if (good_sort_key) {
+                tmp.sort_key = strdup(good_sort_key);
+                if (!tmp.sort_key)
+                        return log_oom();
+        }
 
         if (good_version) {
                 tmp.version = strdup(good_version);