Module: wine Branch: refs/heads/master Commit: 38bfd5e6351801fb20ed41dd3e9a01f7b6b36909 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=38bfd5e6351801fb20ed41dd...
Author: Thomas Weidenmueller wine-patches@reactsoft.com Date: Fri Dec 9 11:22:59 2005 +0100
urlmon: Fix call to ReadFile. The BytesRead parameter passed to ReadFile may never be NULL.
---
dlls/urlmon/umstream.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/urlmon/umstream.c b/dlls/urlmon/umstream.c index f907317..720c8ba 100644 --- a/dlls/urlmon/umstream.c +++ b/dlls/urlmon/umstream.c @@ -225,6 +225,7 @@ static HRESULT WINAPI IStream_fnRead (IS ULONG cb, ULONG* pcbRead) { + DWORD dwBytesRead; IUMCacheStream *This = (IUMCacheStream *)iface;
TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead); @@ -232,7 +233,7 @@ static HRESULT WINAPI IStream_fnRead (IS if ( !pv ) return STG_E_INVALIDPOINTER;
- if ( ! ReadFile( This->handle, pv, cb, pcbRead, NULL ) ) + if ( ! ReadFile( This->handle, pv, cb, (pcbRead ? pcbRead : &dwBytesRead), NULL ) ) return S_FALSE;
if (!*pcbRead)