[mshtml] Fix the size passed to MultiByteToWideChar for real

Dmitry Timoshkov dmitry at codeweavers.com
Thu Apr 23 03:14:55 CDT 2009


"Colin Finck" <mail at colinfinck.de> wrote: wrote:

> @@ -425,6 +425,7 @@ static LPWSTR get_url(void)
>      HKEY hkey;
>      DWORD res, type;
>      DWORD size = INTERNET_MAX_URL_LENGTH*sizeof(WCHAR);
> +    DWORD returned_size;
>      LPWSTR url;
>  
>      static const WCHAR wszGeckoUrl[] = {'G','e','c','k','o','U','r','l',0};
> @@ -438,14 +439,14 @@ static LPWSTR get_url(void)
> >  
>      url = heap_alloc(size);
>  
> -    res = RegQueryValueExW(hkey, wszGeckoUrl, NULL, &type, (LPBYTE)url, &size);
> +    res = RegQueryValueExW(hkey, wszGeckoUrl, NULL, &type, (LPBYTE)url, &returned_size);

returned_size must be intialized first.

-- 
Dmitry.



More information about the wine-devel mailing list