Commit 1dd785d1 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Avoid allocating zero bytes of memory when handling REG_BINARY data.

parent e2dfb0af
...@@ -89,6 +89,8 @@ static BOOL get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment