Fix the size passed to MultiByteToWideChar for real now. (size =

Colin Finck mail at colinfinck.de
Wed Apr 22 21:31:48 CDT 2009


was previously reused for RegQueryValueExW, so the passed size was =
always 1)=0A=
=0A=
---=0A=
 dlls/mshtml/install.c |    6 ++++--=0A=
 1 files changed, 4 insertions(+), 2 deletions(-)=0A=
=0A=
diff --git a/dlls/mshtml/install.c b/dlls/mshtml/install.c=0A=
index 15f6d93..2dd91d8 100644=0A=
--- a/dlls/mshtml/install.c=0A=
+++ b/dlls/mshtml/install.c=0A=
@@ -425,6 +425,7 @@ static LPWSTR get_url(void)=0A=
     HKEY hkey;=0A=
     DWORD res, type;=0A=
     DWORD size =3D INTERNET_MAX_URL_LENGTH*sizeof(WCHAR);=0A=
+    DWORD returned_size;=0A=
     LPWSTR url;=0A=
 =0A=
     static const WCHAR wszGeckoUrl[] =3D =
{'G','e','c','k','o','U','r','l',0};=0A=
@@ -437,15 +438,16 @@ static LPWSTR get_url(void)=0A=
         return NULL;=0A=
 =0A=
     url =3D heap_alloc(size);=0A=
+    returned_size =3D size;=0A=
 =0A=
-    res =3D RegQueryValueExW(hkey, wszGeckoUrl, NULL, &type, =
(LPBYTE)url, &size);=0A=
+    res =3D RegQueryValueExW(hkey, wszGeckoUrl, NULL, &type, =
(LPBYTE)url, &returned_size);=0A=
     RegCloseKey(hkey);=0A=
     if(res !=3D ERROR_SUCCESS || type !=3D REG_SZ) {=0A=
         heap_free(url);=0A=
         return NULL;=0A=
     }=0A=
 =0A=
-    if(size > sizeof(httpW) && !memcmp(url, httpW, sizeof(httpW))) {=0A=
+    if(returned_size > sizeof(httpW) && !memcmp(url, httpW, =
sizeof(httpW))) {=0A=
         strcatW(url, v_formatW);=0A=
         MultiByteToWideChar(CP_ACP, 0, GECKO_VERSION, -1, =
url+strlenW(url), size/sizeof(WCHAR)-strlenW(url));=0A=
     }=0A=
-- =0A=
1.5.6.1.1071.g76fb=0A=
=0A=

------=_NextPart_000_0000_01C9C392.4B11F780--




More information about the wine-patches mailing list