Rob Shearman : rpcrt4: Don' t copy memory from the buffer in NdrConformantStringUnmarshall if we just pointed the memory pointer into the buffer .
Module: wine Branch: master Commit: b9c92e95642325c99f83b4c2cbb610a5b01a47e3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9c92e95642325c99f83b4c2cb... Author: Rob Shearman <rob(a)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));
participants (1)
-
Alexandre Julliard