Commit 8c16ae7a authored by Jon Griffiths's avatar Jon Griffiths Committed by Alexandre Julliard

oleaut32: Fix memcpy overlapping ranges in SysReAllocStringLen.

parent 0cf08782
...@@ -287,7 +287,7 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len) ...@@ -287,7 +287,7 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
* *
* NOTES * NOTES
* See BSTR(), SysAllocStringByteLen(). * See BSTR(), SysAllocStringByteLen().
* *pbstr may be changed by this function. * *old may be changed by this function.
*/ */
int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len) int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
{ {
...@@ -301,7 +301,7 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len) ...@@ -301,7 +301,7 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
*old = (BSTR)(ptr+1); *old = (BSTR)(ptr+1);
*ptr = newbytelen; *ptr = newbytelen;
if (str) { if (str) {
memcpy(*old, str, newbytelen); memmove(*old, str, newbytelen);
(*old)[len] = 0; (*old)[len] = 0;
} else { } else {
/* Subtle hidden feature: The old string data is still there /* Subtle hidden feature: The old string data is still there
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment