URLMON: Fix URLMonikerImpl_Construct

Felix Nawothnig felix.nawothnig at t-online.de
Sat Jul 16 04:42:29 CDT 2005


This fixes

url.c:49: Test failed: failed to create moniker: 0x80004003

(Due to the nature of this bug the test failure may not be reproducable)

Maybe it's possible to write a smatch script which checks if 
uninitialized buffers are passed to [in] parameters? Having Valgrind 
work again would help too.

ChangeLog:
Fix misuse of UrlCombineW
-------------- next part --------------
Index: dlls/urlmon/umon.c
===================================================================
RCS file: /home/wine/wine/dlls/urlmon/umon.c,v
retrieving revision 1.60
diff -u -r1.60 umon.c
--- dlls/urlmon/umon.c	11 Jul 2005 10:23:10 -0000	1.60
+++ dlls/urlmon/umon.c	16 Jul 2005 09:32:03 -0000
@@ -1134,7 +1134,7 @@
 static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
 {
     HRESULT hres;
-    DWORD sizeStr;
+    DWORD sizeStr = 0;
 
     TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
     memset(This, 0, sizeof(*This));
@@ -1145,7 +1145,7 @@
 
     if(lpszLeftURLName) {
         hres = UrlCombineW(lpszLeftURLName, lpszURLName, NULL, &sizeStr, 0);
-        if(FAILED(hres)) {
+        if(FAILED(hres) && hres != E_POINTER) {
             return hres;
         }
         sizeStr++;


More information about the wine-patches mailing list