regedit: Check if any hex data exists before attempting to parse it.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-07-05 13:33:02 +00:00 committed by Alexandre Julliard
parent 5cc1b227b7
commit 1a4c3e5d28

View file

@ -363,9 +363,12 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
WCHAR *end;
DWORD val;
if (!**line)
return FALSE;
/* "hex(xx):" is special */
val = wcstoul(*line, &end, 16);
if (!**line || *end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE))
if (*end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE))
return FALSE;
parser->data_type = val;