Commit 0cb27981 authored by Martin Storsjö's avatar Martin Storsjö Committed by Alexandre Julliard

win32u: Make sure that the stack buffer in set_multi_value_key is large enough.

This fixes stack overflows since edecac8a. Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 7486c406
...@@ -3043,12 +3043,19 @@ static void update_font_association_info(void) ...@@ -3043,12 +3043,19 @@ static void update_font_association_info(void)
static void set_multi_value_key( HKEY hkey, const WCHAR *name, const char *value, DWORD len ) static void set_multi_value_key( HKEY hkey, const WCHAR *name, const char *value, DWORD len )
{ {
WCHAR valueW[256]; WCHAR *valueW;
if (!(valueW = malloc( len * sizeof(WCHAR) )))
{
ERR( "malloc of %d * WCHAR failed\n", len );
return;
}
ascii_to_unicode( valueW, value, len ); ascii_to_unicode( valueW, value, len );
if (value) if (value)
set_reg_value( hkey, name, REG_MULTI_SZ, valueW, len * sizeof(WCHAR) ); set_reg_value( hkey, name, REG_MULTI_SZ, valueW, len * sizeof(WCHAR) );
else if (name) else if (name)
reg_delete_value( hkey, name ); reg_delete_value( hkey, name );
free( valueW );
} }
static void update_font_system_link_info(void) static void update_font_system_link_info(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment