[U-Boot] [PATCH 1/1] efi_loader: fix CopyMem()

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Jan 9 20:41:13 UTC 2019


CopyMem() must support overlapping buffers. So replace memcpy() by
memmove().

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 88386ff676..dbf0d56c1d 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2483,7 +2483,7 @@ static void EFIAPI efi_copy_mem(void *destination, const void *source,
 				size_t length)
 {
 	EFI_ENTRY("%p, %p, %ld", destination, source, (unsigned long)length);
-	memcpy(destination, source, length);
+	memmove(destination, source, length);
 	EFI_EXIT(EFI_SUCCESS);
 }
 
-- 
2.20.1



More information about the U-Boot mailing list