diff options
author | Tom Rini <trini@konsulko.com> | 2019-09-12 10:35:46 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-09-12 10:35:46 -0400 |
commit | 3ee0284a163f7c3a20c8598e319ba1b5cddf6519 (patch) | |
tree | 5b21ac6490c7d07ef627d240da2a57580ee53b76 /lib/efi_loader/efi_device_path_to_text.c | |
parent | 5ba8b1254311d00e2bdd9e227b78bdb7e89e69dd (diff) | |
parent | 8262578535f18cdab95318828e6fd6464721ac54 (diff) |
Merge tag 'efi-2019-10-rc4-4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for v2019.10-rc4 (4)
Fixes for the EFI_FILE_PROTOCOL:
* correctly iterate over directories
* correct Unicode conversion of file names
* parameter checks
Diffstat (limited to 'lib/efi_loader/efi_device_path_to_text.c')
-rw-r--r-- | lib/efi_loader/efi_device_path_to_text.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c index b20b7c097c..0f3796b373 100644 --- a/lib/efi_loader/efi_device_path_to_text.c +++ b/lib/efi_loader/efi_device_path_to_text.c @@ -29,15 +29,15 @@ const efi_guid_t efi_guid_device_path_to_text_protocol = static u16 *efi_str_to_u16(char *str) { efi_uintn_t len; - u16 *out; + u16 *out, *dst; efi_status_t ret; - len = strlen(str) + 1; - ret = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, len * sizeof(u16), - (void **)&out); + len = sizeof(u16) * (utf8_utf16_strlen(str) + 1); + ret = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, len, (void **)&out); if (ret != EFI_SUCCESS) return NULL; - ascii2unicode(out, str); + dst = out; + utf8_utf16_strcpy(&dst, str); return out; } |