Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed May 9, 2016
1 parent 45cd68c commit a966570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/string.c
Expand Up @@ -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;
Expand Down

0 comments on commit a966570

Please sign in to comment.