urlmon: Correctly fix IStream::Read.
Don't dereference a possible NULL pointer.
This commit is contained in:
parent
c26ad82e75
commit
ac459e7ea0
|
@ -225,7 +225,7 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface,
|
|||
ULONG cb,
|
||||
ULONG* pcbRead)
|
||||
{
|
||||
DWORD dwBytesRead;
|
||||
ULONG dwBytesRead;
|
||||
IUMCacheStream *This = (IUMCacheStream *)iface;
|
||||
|
||||
TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead);
|
||||
|
@ -233,7 +233,10 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface,
|
|||
if ( !pv )
|
||||
return STG_E_INVALIDPOINTER;
|
||||
|
||||
if ( ! ReadFile( This->handle, pv, cb, (pcbRead ? pcbRead : &dwBytesRead), NULL ) )
|
||||
if ( !pcbRead)
|
||||
pcbRead = &dwBytesRead;
|
||||
|
||||
if ( ! ReadFile( This->handle, pv, cb, (LPDWORD)pcbRead, NULL ) )
|
||||
return S_FALSE;
|
||||
|
||||
if (!*pcbRead)
|
||||
|
|
Loading…
Reference in New Issue