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>
This commit is contained in:
parent
e2dfb0aff4
commit
1dd785d149
|
@ -89,6 +89,8 @@ static BOOL get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator,
|
||||||
BYTE hex0, hex1, *ptr;
|
BYTE hex0, hex1, *ptr;
|
||||||
int i = 0, destByteIndex = 0, datalen = lstrlenW(data);
|
int i = 0, destByteIndex = 0, datalen = lstrlenW(data);
|
||||||
|
|
||||||
|
if (!datalen) return TRUE;
|
||||||
|
|
||||||
*size_bytes = ((datalen + datalen % 2) / 2) * sizeof(BYTE);
|
*size_bytes = ((datalen + datalen % 2) / 2) * sizeof(BYTE);
|
||||||
*data_bytes = malloc(*size_bytes);
|
*data_bytes = malloc(*size_bytes);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue