mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:13:00 +00:00
[WINESYNC] reg: Avoid allocating zero bytes of memory when handling REG_BINARY data.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 1dd785d1490f64c33e89003453f7c82292d185d5 by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
parent
d8277eee6f
commit
4f9404e600
2 changed files with 3 additions and 1 deletions
|
@ -89,6 +89,8 @@ static BOOL get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator,
|
|||
BYTE hex0, hex1, *ptr;
|
||||
int i = 0, destByteIndex = 0, datalen = lstrlenW(data);
|
||||
|
||||
if (!datalen) return TRUE;
|
||||
|
||||
*size_bytes = ((datalen + datalen % 2) / 2) * sizeof(BYTE);
|
||||
*data_bytes = malloc(*size_bytes);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue