[PATCH 4/5] regedit: Handle cases where no data is converted

Hugh McMaster hugh.mcmaster at outlook.com
Mon Apr 10 04:50:52 CDT 2017


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/regedit/regproc.c       | 2 +-
 programs/regedit/tests/regedit.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index 4b71a29..932bc15 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -156,7 +156,7 @@ static BOOL convertHexToDWord(WCHAR* str, DWORD *dw)
 
     while (*end == ' ' || *end == '\t') end++;
 
-    if ((*dw == ~0u && errno == ERANGE) || (*end && *end != ';'))
+    if (buf == end || (*dw == ~0u && errno == ERANGE) || (*end && *end != ';'))
     {
         output_message(STRING_INVALID_HEX);
         HeapFree(GetProcessHeap(), 0, buf);
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c
index d14bb05..e32489d 100644
--- a/programs/regedit/tests/regedit.c
+++ b/programs/regedit/tests/regedit.c
@@ -511,7 +511,7 @@ static void test_invalid_import(void)
                     "\"Test12b\"=dword:hello\n"
                     "\"Test12c\"=dword:123456789\n"
                     "\"Test12d\"=dword:012345678\n\n");
-    todo_wine verify_reg_nonexist(hkey, "Test12a");
+    verify_reg_nonexist(hkey, "Test12a");
     verify_reg_nonexist(hkey, "Test12b");
     verify_reg_nonexist(hkey, "Test12c");
     todo_wine verify_reg_nonexist(hkey, "Test12d");
-- 
2.7.4




More information about the wine-patches mailing list