From: Heinrich Schuchardt Date: Sun, 22 Mar 2020 08:52:48 +0000 (+0100) Subject: efi_loader: fix freestanding memmove() X-Git-Tag: v2020.04-rc4~7^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=72291a9d83ec2fe50cc8fac304e8ecd5534daf5e;p=oweals%2Fu-boot.git efi_loader: fix freestanding memmove() For EFI binaries we have to provide an implementation of memmove() in efi_freestanding.c. Before this patch the memmove() function was copying in the wrong direction. Signed-off-by: Heinrich Schuchardt --- diff --git a/lib/efi_loader/efi_freestanding.c b/lib/efi_loader/efi_freestanding.c index dcf5d1c49a..bd0dff162f 100644 --- a/lib/efi_loader/efi_freestanding.c +++ b/lib/efi_loader/efi_freestanding.c @@ -47,7 +47,7 @@ void *memmove(void *dest, const void *src, size_t n) u8 *d = dest; const u8 *s = src; - if (d >= s) { + if (d <= s) { for (; n; --n) *d++ = *s++; } else {