mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
user32: Fix a potential buffer overflow.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e725d9e3c7
commit
e0843d234e
1 changed files with 1 additions and 1 deletions
|
@ -548,7 +548,7 @@ static DWORD load_entry( struct sysparam_entry *entry, void *data, DWORD size )
|
|||
if (RegQueryValueExW( base_key, entry->regval + 1, NULL, &type, data, &count )) count = 0;
|
||||
}
|
||||
/* make sure strings are null-terminated */
|
||||
if (size && count == size && type == REG_SZ) ((WCHAR *)data)[count - 1] = 0;
|
||||
if (size && count == size && type == REG_SZ) ((WCHAR *)data)[count / sizeof(WCHAR) - 1] = 0;
|
||||
entry->loaded = TRUE;
|
||||
return count;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue