mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 23:42:56 +00:00
[WINESYNC] 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> wine commit id 60c8dfdd0bbaff4a2369f884ec1a553a06735676 by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
parent
4f9404e600
commit
64312c4fd4
2 changed files with 9 additions and 1 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…
Add table
Add a link
Reference in a new issue