[PATCH] Regedit: Stop crash when modifying a DWORD value.

Alexandre Julliard julliard at winehq.org
Wed Mar 20 14:18:31 CDT 2019


Alistair Leslie-Hughes <leslie_alistair at hotmail.com> writes:

> @@ -282,8 +282,12 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
>              else error_code_messagebox(hwnd, IDS_SET_VALUE_FAILED);
>          }
>      } else if ( type == REG_DWORD ) {
> +        WCHAR buffer[256];
>          static const WCHAR x[] = {'%','x',0};
> -        wsprintfW(stringValueData, x, *((DWORD*)stringValueData));
> +        DWORD value = *((DWORD*)stringValueData);
> +        heap_free(stringValueData);
> +        stringValueData = buffer;

This can't work, it needs to be allocated on the heap.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list