summaryrefslogtreecommitdiffstats
path: root/lib/efi_loader/efi_file.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-11-10 07:24:16 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-11-14 05:05:46 +0100
commit792aee11501f8033af28461c2ea4533e02e65abf (patch)
treea3b7dc2d76661223d4631f00632464b0bd46cc9a /lib/efi_loader/efi_file.c
parent337c97d9353c7277620322fda1f8cdd3d2677065 (diff)
downloadu-boot-792aee11501f8033af28461c2ea4533e02e65abf.tar.gz
u-boot-792aee11501f8033af28461c2ea4533e02e65abf.tar.xz
u-boot-792aee11501f8033af28461c2ea4533e02e65abf.zip
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: fbe4c7df0087 ("efi_loader: enable file SetInfo()") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_file.c')
-rw-r--r--lib/efi_loader/efi_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 44fafae058..72b7ec1e63 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -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;