From b52fafb26d90b77cfc259fcbdab3c95a571bacb1 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Wed, 11 Aug 2021 14:59:46 +0200 Subject: [PATCH] sd-boot: Fix possible null pointer dereference Auto entries are showing garbage for the version in print_status() because StrDuplicate does not expect null pointers. --- src/boot/efi/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index d0a3bce159..54d704f0d1 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -1722,7 +1722,7 @@ static ConfigEntry *config_entry_add_loader( *entry = (ConfigEntry) { .type = type, .title = StrDuplicate(title), - .version = StrDuplicate(version), + .version = version ? StrDuplicate(version) : NULL, .device = device, .loader = StrDuplicate(loader), .id = StrDuplicate(id),