mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 10:53:38 +00:00
win32u: Make sure that the stack buffer in set_multi_value_key is large enough.
This fixes stack overflows since
edecac8afd
.
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
7486c4061e
commit
0cb2798125
|
@ -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 )
|
||||
{
|
||||
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 );
|
||||
if (value)
|
||||
set_reg_value( hkey, name, REG_MULTI_SZ, valueW, len * sizeof(WCHAR) );
|
||||
else if (name)
|
||||
reg_delete_value( hkey, name );
|
||||
free( valueW );
|
||||
}
|
||||
|
||||
static void update_font_system_link_info(void)
|
||||
|
|
Loading…
Reference in a new issue