git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b9f0a3
)
Kernel - Fixed infinite loop in memmove (exposed by AcessNative's use of SDL)
author
John Hodge
<
[email protected]
>
Sun, 23 Oct 2011 03:59:52 +0000
(11:59 +0800)
committer
John Hodge
<
[email protected]
>
Sun, 23 Oct 2011 03:59:52 +0000
(11:59 +0800)
Kernel/lib.c
patch
|
blob
|
history
diff --git
a/Kernel/lib.c
b/Kernel/lib.c
index
6263dc8
..
73b6432
100644
(file)
--- 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);
UCC
git Repository :: git.ucc.asn.au