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

Alexandre Julliard julliard at winehq.org
Wed Jul 5 15:41:02 CDT 2017


Module: wine
Branch: master
Commit: 1a4c3e5d287dd8debda28fcf77e7270338e502df
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1a4c3e5d287dd8debda28fcf77e7270338e502df

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Wed Jul  5 13:33:02 2017 +0000

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

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 74f0640..e94d14e 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;




More information about the wine-cvs mailing list