Module: wine Branch: master Commit: 8620d15d3960921a8f316e0653ef0d11ceb55e89 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8620d15d3960921a8f316e0653... Author: Rob Shearman <rob(a)codeweavers.com> Date: Wed Mar 14 15:46:16 2007 +0000 rpcrt4: Unmarshal NULL OLE interfaces properly by handling the case of a 0 stream size. --- dlls/rpcrt4/ndr_ole.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/rpcrt4/ndr_ole.c b/dlls/rpcrt4/ndr_ole.c index 6c32121..b65e18b 100644 --- a/dlls/rpcrt4/ndr_ole.c +++ b/dlls/rpcrt4/ndr_ole.c @@ -288,12 +288,14 @@ unsigned char * WINAPI NdrInterfacePointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg *(LPVOID*)ppMemory = NULL; if (pStubMsg->Buffer + sizeof(DWORD) < (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength) { stream = RpcStream_Create(pStubMsg, FALSE); - if (stream) { + if (!stream) RpcRaiseException(E_OUTOFMEMORY); + if (*((RpcStreamImpl *)stream)->size != 0) hr = COM_UnmarshalInterface(stream, &IID_NULL, (LPVOID*)ppMemory); - IStream_Release(stream); - if (FAILED(hr)) + else + hr = S_OK; + IStream_Release(stream); + if (FAILED(hr)) RpcRaiseException(hr); - } } return NULL; }