[PATCH 3/3] regedit: Do not create registry keys that end without a closing bracket

Hugh McMaster hugh.mcmaster at outlook.com
Thu Jun 8 04:04:36 CDT 2017


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

diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index d5be72f..7bac6dc 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -568,6 +568,7 @@ static void processRegEntry(WCHAR* stdInput, BOOL isUnicode)
         keyEnd = strrchrW(stdInput, ']');
         if (keyEnd)
             *keyEnd='\0';
+        else return;
 
         /* delete the key if we encounter '-' at the start of reg key */
         if (stdInput[0] == '-')
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c
index 6f56191..550c22b 100644
--- a/programs/regedit/tests/regedit.c
+++ b/programs/regedit/tests/regedit.c
@@ -1155,7 +1155,7 @@ static void test_key_creation_and_deletion(void)
 
     exec_import_str("REGEDIT4\n\n"
                     "[HKEY_CURRENT_USER\\" KEY_BASE "\\No_Closing_Bracket\n");
-    todo_wine verify_key_nonexist(hkey, "No_Closing_Bracket");
+    verify_key_nonexist(hkey, "No_Closing_Bracket");
 
     exec_import_str("REGEDIT4\n\n"
                     "[ HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1a]\n");
@@ -1210,7 +1210,7 @@ static void test_key_creation_and_deletion(void)
     ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
 
     lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
-    todo_wine ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: got %d, expected 0\n", lr);
+    ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: got %d, expected 0\n", lr);
 }
 
 static void test_value_deletion(void)
@@ -1262,7 +1262,7 @@ static void test_value_deletion(void)
     ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr);
 
     lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
-    todo_wine ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: got %d, expected 0\n", lr);
+    ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: got %d, expected 0\n", lr);
 }
 
 START_TEST(regedit)
-- 
2.7.4




More information about the wine-patches mailing list