]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: fix CopyMem()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 9 Jan 2019 20:41:13 +0000 (21:41 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 13 Feb 2019 08:40:06 +0000 (09:40 +0100)
CopyMem() must support overlapping buffers. So replace memcpy() by
memmove().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_loader/efi_boottime.c

index 88386ff676064d7f9c0c6fcd500f7cef4f3aaff3..dbf0d56c1d358328e31fed9d5f3087462919227d 100644 (file)
@@ -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);
 }