From: Jan Janssen Date: Wed, 11 Aug 2021 12:59:46 +0000 (+0200) Subject: sd-boot: Fix possible null pointer dereference X-Git-Tag: v250-rc1~835^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b52fafb26d90b77cfc259fcbdab3c95a571bacb1;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index d0a3bce159d..54d704f0d13 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),