From: Michael Brown Date: Mon, 9 May 2016 15:01:06 +0000 (+0100) Subject: [libc] Avoid implicit assumptions about potentially-optimised memcpy() X-Git-Tag: v1.20.1~450 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a966570dce690a5eba139fd941e12e4c6d445e22;p=thirdparty%2Fipxe.git [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 --- diff --git a/src/core/string.c b/src/core/string.c index 3e658e54e..5a185e635 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;