diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-07-26 07:45:18 +0200 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-08-13 11:09:49 +0200 |
commit | e7496e57a045af70fd453f25c827f7c0522a3a71 (patch) | |
tree | 7b4ae83c3488f628013ce5698357cf077c36b55a /lib/efi_loader/efi_device_path_to_text.c | |
parent | 7d6fadef84de958e83856efdd257ae98280dd74a (diff) |
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: bd3d75bb0c58 ("efi_loader: multi part device paths to text")
Addresses-Coverity: 350434 ("Uninitialized scalar variable")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_device_path_to_text.c')
-rw-r--r-- | lib/efi_loader/efi_device_path_to_text.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c index 4d73954ef89..6c428ee061f 100644 --- a/lib/efi_loader/efi_device_path_to_text.c +++ b/lib/efi_loader/efi_device_path_to_text.c @@ -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: |