rpcrt4 [1/3]: Initialize allocated pointers to NULL in PointerUnmarshall.

Dan Hipschman dsh at linux.ucla.edu
Fri Nov 2 17:22:47 CDT 2007


This patch initializes allocated pointers in PointerUnmarshall since later
code checks the value for NULL (specifically, NdrConformantArrayUnmarshall).

---
 dlls/rpcrt4/ndr_marshall.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 7be2ee6..16c38a0 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -976,8 +976,10 @@ static void PointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
 
   if (pointer_needs_unmarshaling) {
     if (attr & RPC_FC_P_DEREF) {
-      if (!*pPointer || fMustAlloc)
+      if (!*pPointer || fMustAlloc) {
         *pPointer = NdrAllocate(pStubMsg, sizeof(void *));
+        *(unsigned char**) *pPointer = NULL;
+      }
       pPointer = *(unsigned char***)pPointer;
       TRACE("deref => %p\n", pPointer);
     }



More information about the wine-patches mailing list