From: Heinrich Schuchardt Date: Wed, 9 Jan 2019 20:41:13 +0000 (+0100) Subject: efi_loader: fix CopyMem() X-Git-Tag: v2019.04-rc2~13^2~26 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0bc81a717d1ce90008f9f8ae8b3c086d4405a295;p=oweals%2Fu-boot.git efi_loader: fix CopyMem() CopyMem() must support overlapping buffers. So replace memcpy() by memmove(). Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- 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); }