rpcrt4: Clear the newly allocated memory used for complex arrays and structs.

This commit is contained in:
Robert Shearman 2006-01-18 11:29:50 +01:00 committed by Alexandre Julliard
parent a4000349f8
commit 68b9225022

View file

@ -1767,7 +1767,10 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
if (fMustAlloc || !*ppMemory)
{
*ppMemory = NdrAllocate(pStubMsg, size);
memset(*ppMemory, 0, size);
}
pFormat += 4;
if (*(const WORD*)pFormat) conf_array = pFormat + *(const WORD*)pFormat;
@ -2170,7 +2173,10 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
esize = ComplexStructSize(pStubMsg, pFormat);
if (fMustAlloc || !*ppMemory)
{
*ppMemory = NdrAllocate(pStubMsg, pStubMsg->MaxCount * esize);
memset(*ppMemory, 0, pStubMsg->MaxCount * esize);
}
pMemory = *ppMemory;
for (count = 0; count < pStubMsg->ActualCount; count++)