rpcrt4: Fix NdrConformantStringUnmarshall to always increment the buffer during unmarshalling.

safe_copy_from_buffer has the side-effect of incrementing the buffer and 
this still needs to be done when we point the memory into the buffer.

(Thanks to Maarten Lankhorst for finding the mistake and suggesting a fix.)
This commit is contained in:
Rob Shearman 2007-12-20 09:51:47 +00:00 committed by Alexandre Julliard
parent aaa0e5090a
commit 9a888e6465
1 changed files with 3 additions and 1 deletions

View File

@ -890,7 +890,9 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
*ppMemory = NdrAllocate(pStubMsg, memsize);
}
if (*ppMemory != pStubMsg->Buffer)
if (*ppMemory == pStubMsg->Buffer)
safe_buffer_increment(pStubMsg, bufsize);
else
safe_copy_from_buffer(pStubMsg, *ppMemory, bufsize);
if (*pFormat == RPC_FC_C_CSTRING) {