Robert Shearman : rpcrt4: Only attempt to marshal an object if it is non-NULL.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 31 06:04:21 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 4197140738bb13baae270efa0ad3add90188765f
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=4197140738bb13baae270efa0ad3add90188765f

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Jan 31 12:21:13 2006 +0100

rpcrt4: Only attempt to marshal an object if it is non-NULL.

---

 dlls/rpcrt4/ndr_ole.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/rpcrt4/ndr_ole.c b/dlls/rpcrt4/ndr_ole.c
index 48f5b72..4bdeefe 100644
--- a/dlls/rpcrt4/ndr_ole.c
+++ b/dlls/rpcrt4/ndr_ole.c
@@ -257,9 +257,13 @@ unsigned char * WINAPI NdrInterfacePoint
   if (pStubMsg->Buffer + sizeof(DWORD) < (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength) {
     stream = RpcStream_Create(pStubMsg, TRUE);
     if (stream) {
-      hr = COM_MarshalInterface(stream, riid, (LPUNKNOWN)pMemory,
-                                pStubMsg->dwDestContext, pStubMsg->pvDestContext,
-                                MSHLFLAGS_NORMAL);
+      if (pMemory)
+        hr = COM_MarshalInterface(stream, riid, (LPUNKNOWN)pMemory,
+                                  pStubMsg->dwDestContext, pStubMsg->pvDestContext,
+                                  MSHLFLAGS_NORMAL);
+      else
+        hr = S_OK;
+
       IStream_Release(stream);
       if (FAILED(hr))
         RpcRaiseException(hr);




More information about the wine-cvs mailing list