Hugh McMaster : regedit: Do not create registry keys that end without a closing bracket.
Alexandre Julliard
julliard at winehq.org
Thu Jun 8 15:54:57 CDT 2017
Module: wine
Branch: master
Commit: 5669282e1d7c45a59d69fb1214a776f3eabd29cf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5669282e1d7c45a59d69fb1214a776f3eabd29cf
Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date: Thu Jun 8 09:04:36 2017 +0000
regedit: Do not create registry keys that end without a closing bracket.
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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)
More information about the wine-cvs
mailing list