Thomas Weidenmueller : urlmon: Fix call to ReadFile.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 9 05:54:11 CST 2005


Module: wine
Branch: refs/heads/master
Commit: 38bfd5e6351801fb20ed41dd3e9a01f7b6b36909
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=38bfd5e6351801fb20ed41dd3e9a01f7b6b36909

Author: Thomas Weidenmueller <wine-patches at 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)




More information about the wine-cvs mailing list