efi_loader: incorrect buffer size in efi_file_setinfo()

When copying a string with must allocate a byte for the terminating '\0' in
the target buffer.

Fixes: fbe4c7df00 ("efi_loader: enable file SetInfo()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Heinrich Schuchardt committed 2020-11-14 05:05:46 +01:00
1 parent 337c97d935
commit 792aee1150
1 file changed
+1 -1
+1 -1
View File
@@ -723,7 +723,7 @@ static efi_status_t EFIAPI efi_file_setinfo(struct efi_file_handle *file,
goto out;
}
/* Check for renaming */
new_file_name = malloc(utf16_utf8_strlen(info->file_name));
new_file_name = malloc(utf16_utf8_strlen(info->file_name) + 1);
if (!new_file_name) {
ret = EFI_OUT_OF_RESOURCES;
goto out;