]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[libc] Avoid implicit assumptions about potentially-optimised memcpy()
authorMichael Brown <mcb30@ipxe.org>
Mon, 9 May 2016 15:01:06 +0000 (16:01 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 9 May 2016 15:23:38 +0000 (16:23 +0100)
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 <mcb30@ipxe.org>
src/core/string.c

index 3e658e54ebe0172b5ca59a6f53c89700718d6d5d..5a185e6356e799dc5447aa8e113f375518c58f52 100644 (file)
@@ -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;