Rob Shearman : rpcrt4: Don' t copy memory from the buffer in NdrConformantStringUnmarshall if we just pointed the memory pointer into the buffer .
Alexandre Julliard
julliard at winehq.org
Tue Dec 18 07:34:43 CST 2007
Module: wine
Branch: master
Commit: b9c92e95642325c99f83b4c2cbb610a5b01a47e3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9c92e95642325c99f83b4c2cbb610a5b01a47e3
Author: Rob Shearman <rob at codeweavers.com>
Date: Mon Dec 17 18:20:34 2007 +0000
rpcrt4: Don't copy memory from the buffer in NdrConformantStringUnmarshall if we just pointed the memory pointer into the buffer.
(Reported by Dan Kegel.)
---
dlls/rpcrt4/ndr_marshall.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 2de650d..ca40bfa 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -890,7 +890,8 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
*ppMemory = NdrAllocate(pStubMsg, memsize);
}
- safe_copy_from_buffer(pStubMsg, *ppMemory, bufsize);
+ if (*ppMemory != pStubMsg->Buffer)
+ safe_copy_from_buffer(pStubMsg, *ppMemory, bufsize);
if (*pFormat == RPC_FC_C_CSTRING) {
TRACE("string=%s\n", debugstr_a((char*)*ppMemory));
More information about the wine-cvs
mailing list