mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 08:49:15 +00:00
reg: Prevent buffer over-read when querying REG_NONE values with no data.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1dd785d149
commit
60c8dfdd0b
1 changed files with 8 additions and 0 deletions
|
@ -50,7 +50,15 @@ static WCHAR *reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes)
|
|||
WCHAR *ptr;
|
||||
|
||||
buffer = malloc((size_bytes * 2 + 1) * sizeof(WCHAR));
|
||||
|
||||
if (!size_bytes)
|
||||
{
|
||||
*buffer = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
ptr = buffer;
|
||||
|
||||
for (i = 0; i < size_bytes; i++)
|
||||
ptr += swprintf(ptr, 3, L"%02X", src[i]);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue