rpcrt4: Unmarshal NULL OLE interfaces properly by handling the case of a 0 stream size.
This commit is contained in:
parent
2b5524867d
commit
8620d15d39
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue