|
From: <sv...@va...> - 2009-11-03 21:14:48
|
Author: tom
Date: 2009-11-03 21:14:31 +0000 (Tue, 03 Nov 2009)
New Revision: 10925
Log:
Rework VG_(memmove) in the case where the destination address is greater
that the source address to use the same logic as the mc_replace_strmem.c
version so that underflow is avoided. Fixes #211008.
Modified:
trunk/coregrind/m_libcbase.c
Modified: trunk/coregrind/m_libcbase.c
===================================================================
--- trunk/coregrind/m_libcbase.c 2009-11-03 21:02:16 UTC (rev 10924)
+++ trunk/coregrind/m_libcbase.c 2009-11-03 21:14:31 UTC (rev 10925)
@@ -437,8 +437,8 @@
}
}
else if (dest > src) {
- for (i = sz - 1; i >= 0; i--) {
- ((UChar*)dest)[i] = ((UChar*)src)[i];
+ for (i = 0; i < sz; i++) {
+ ((UChar*)dest)[sz-i-1] = ((UChar*)src)[sz-i-1];
}
}
return dest;
|