From 1a4c3e5d287dd8debda28fcf77e7270338e502df Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Wed, 5 Jul 2017 13:33:02 +0000 Subject: [PATCH] regedit: Check if any hex data exists before attempting to parse it. Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- programs/regedit/regproc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 74f0640472f..e94d14e0fe9 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -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;