From a966570dce690a5eba139fd941e12e4c6d445e22 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 9 May 2016 16:01:06 +0100 Subject: [PATCH] [libc] Avoid implicit assumptions about potentially-optimised memcpy() Do not assume that an architecture-specific optimised memcpy() will have the same properties as generic_memcpy() in terms of handling overlapping regions. Signed-off-by: Michael Brown --- src/core/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/string.c b/src/core/string.c index 3e658e54..5a185e63 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -81,7 +81,7 @@ void * generic_memmove ( void *dest, const void *src, size_t len ) { uint8_t *dest_bytes = ( dest + len ); if ( dest < src ) - return memcpy ( dest, src, len ); + return generic_memcpy ( dest, src, len ); while ( len-- ) *(--dest_bytes) = *(--src_bytes); return dest;