]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Fix null pointer dereference
authorJan Janssen <medhefgo@web.de>
Sat, 7 May 2022 09:15:33 +0000 (11:15 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 7 May 2022 12:56:06 +0000 (21:56 +0900)
src/boot/efi/boot.c

index 3e7cc74b175731a46b13fde547e186ba5621fd4a..fb08b99333b8e2e577c9afd504ee0bc6c30f105d 100644 (file)
@@ -1916,7 +1916,7 @@ static ConfigEntry *config_entry_add_loader(
                 .device = device,
                 .loader = xstrdup(loader),
                 .id = xstrdup(id),
-                .sort_key = xstrdup(sort_key),
+                .sort_key = sort_key ? xstrdup(sort_key) : NULL,
                 .key = key,
                 .tries_done = UINTN_MAX,
                 .tries_left = UINTN_MAX,