rpcrt4: Memory should only be cleared in ComplexUnmarshall, not in ComplexMarshall.

Also clear memory when FC_STRUCTPAD* is encountered.
This commit is contained in:
Rob Shearman 2007-12-19 14:53:12 +00:00 committed by Alexandre Julliard
parent 50cab7736a
commit 22b20879f7
1 changed files with 5 additions and 4 deletions

View File

@ -2008,10 +2008,10 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg,
break;
}
case RPC_FC_ALIGNM4:
ALIGN_POINTER_CLEAR(pMemory, 4);
ALIGN_POINTER(pMemory, 4);
break;
case RPC_FC_ALIGNM8:
ALIGN_POINTER_CLEAR(pMemory, 8);
ALIGN_POINTER(pMemory, 8);
break;
case RPC_FC_STRUCTPAD1:
case RPC_FC_STRUCTPAD2:
@ -2127,10 +2127,10 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
break;
}
case RPC_FC_ALIGNM4:
ALIGN_POINTER(pMemory, 4);
ALIGN_POINTER_CLEAR(pMemory, 4);
break;
case RPC_FC_ALIGNM8:
ALIGN_POINTER(pMemory, 8);
ALIGN_POINTER_CLEAR(pMemory, 8);
break;
case RPC_FC_STRUCTPAD1:
case RPC_FC_STRUCTPAD2:
@ -2139,6 +2139,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
case RPC_FC_STRUCTPAD5:
case RPC_FC_STRUCTPAD6:
case RPC_FC_STRUCTPAD7:
memset(pMemory, 0, *pFormat - RPC_FC_STRUCTPAD1 + 1);
pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1;
break;
case RPC_FC_EMBEDDED_COMPLEX: