rpcrt4: Unmarshal NULL OLE interfaces properly by handling the case of a 0 stream size.

This commit is contained in:
Rob Shearman 2007-03-14 15:46:16 +00:00 committed by Alexandre Julliard
parent 2b5524867d
commit 8620d15d39
1 changed files with 6 additions and 4 deletions

View File

@ -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;
}