Robert Shearman : rpcrt4: Clear the newly allocated memory used for
complex arrays and structs.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jan 18 05:28:35 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 68b9225022d78b85490328e02a8f18e60fe3bb44
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=68b9225022d78b85490328e02a8f18e60fe3bb44
Author: Robert Shearman <rob at codeweavers.com>
Date: Wed Jan 18 11:29:50 2006 +0100
rpcrt4: Clear the newly allocated memory used for complex arrays and structs.
---
dlls/rpcrt4/ndr_marshall.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 026f517..6a681a7 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -1767,7 +1767,10 @@ unsigned char * WINAPI NdrComplexStructU
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 NdrComplexArrayUn
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++)
More information about the wine-cvs
mailing list