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
1 changed files with 4 additions and 1 deletions

View File

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