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.
This commit is contained in:
Jan Janssen
2021-08-12 09:48:37 +02:00
parent b2cf9922a4
commit b52fafb26d
+1 -1
View File
@@ -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),