Commit 22b20879 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

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

Also clear memory when FC_STRUCTPAD* is encountered.
parent 50cab773
...@@ -2008,10 +2008,10 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg, ...@@ -2008,10 +2008,10 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg,
break; break;
} }
case RPC_FC_ALIGNM4: case RPC_FC_ALIGNM4:
ALIGN_POINTER_CLEAR(pMemory, 4); ALIGN_POINTER(pMemory, 4);
break; break;
case RPC_FC_ALIGNM8: case RPC_FC_ALIGNM8:
ALIGN_POINTER_CLEAR(pMemory, 8); ALIGN_POINTER(pMemory, 8);
break; break;
case RPC_FC_STRUCTPAD1: case RPC_FC_STRUCTPAD1:
case RPC_FC_STRUCTPAD2: case RPC_FC_STRUCTPAD2:
...@@ -2127,10 +2127,10 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, ...@@ -2127,10 +2127,10 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
break; break;
} }
case RPC_FC_ALIGNM4: case RPC_FC_ALIGNM4:
ALIGN_POINTER(pMemory, 4); ALIGN_POINTER_CLEAR(pMemory, 4);
break; break;
case RPC_FC_ALIGNM8: case RPC_FC_ALIGNM8:
ALIGN_POINTER(pMemory, 8); ALIGN_POINTER_CLEAR(pMemory, 8);
break; break;
case RPC_FC_STRUCTPAD1: case RPC_FC_STRUCTPAD1:
case RPC_FC_STRUCTPAD2: case RPC_FC_STRUCTPAD2:
...@@ -2139,6 +2139,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, ...@@ -2139,6 +2139,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
case RPC_FC_STRUCTPAD5: case RPC_FC_STRUCTPAD5:
case RPC_FC_STRUCTPAD6: case RPC_FC_STRUCTPAD6:
case RPC_FC_STRUCTPAD7: case RPC_FC_STRUCTPAD7:
memset(pMemory, 0, *pFormat - RPC_FC_STRUCTPAD1 + 1);
pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1; pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1;
break; break;
case RPC_FC_EMBEDDED_COMPLEX: case RPC_FC_EMBEDDED_COMPLEX:
......
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