efi_loader: fix efi_convert_device_path_to_text()

Ensure that the string we convert to UTF-16 is NUL terminated even
if the device path only contains end nodes.

Fixes: bd3d75bb0c ("efi_loader: multi part device paths to text")
Addresses-Coverity: 350434 ("Uninitialized scalar variable")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt 2022-07-26 07:45:18 +02:00
parent 7d6fadef84
commit e7496e57a0

View File

@ -432,6 +432,7 @@ static uint16_t EFIAPI *efi_convert_device_path_to_text(
*(u8 **)&device_path += device_path->length;
}
*str = 0;
text = efi_str_to_u16(buffer);
out: