From: John Hodge Date: Sun, 23 Oct 2011 03:59:52 +0000 (+0800) Subject: Kernel - Fixed infinite loop in memmove (exposed by AcessNative's use of SDL) X-Git-Tag: rel0.14~208 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1081538c9f2903bec7ad003ab29fadd06bddc7b8;p=tpg%2Facess2.git Kernel - Fixed infinite loop in memmove (exposed by AcessNative's use of SDL) --- diff --git a/Kernel/lib.c b/Kernel/lib.c index 6263dc8a..73b6432e 100644 --- a/Kernel/lib.c +++ b/Kernel/lib.c @@ -960,6 +960,9 @@ void *memmove(void *__dest, const void *__src, size_t len) char *dest = __dest; const char *src = __src; void *ret = __dest; + + if( len == 0 || dest == src ) + return dest; if( (tVAddr)dest > (tVAddr)src + len ) return memcpy(dest, src, len);