Hugh McMaster : regedit: Null terminate hex-formatted REG_SZ data if necessary.

Alexandre Julliard julliard at winehq.org
Mon Apr 23 17:58:36 CDT 2018


Module: wine
Branch: master
Commit: 829c0ced694df890b7770a40ada9bcab4d1e17c9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=829c0ced694df890b7770a40ada9bcab4d1e17c9

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Mon Apr 23 13:37:27 2018 +0000

regedit: Null terminate hex-formatted REG_SZ data if necessary.

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

---

 programs/regedit/regproc.c       | 3 ++-
 programs/regedit/tests/regedit.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index 35b0322..84a16f9 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -507,7 +507,8 @@ static void free_parser_data(struct parser *parser)
 
 static void prepare_hex_string_data(struct parser *parser)
 {
-    if (parser->data_type == REG_EXPAND_SZ || parser->data_type == REG_MULTI_SZ)
+    if (parser->data_type == REG_EXPAND_SZ || parser->data_type == REG_MULTI_SZ ||
+        parser->data_type == REG_SZ)
     {
         if (parser->is_unicode)
         {
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c
index 41712a1..845ab00 100644
--- a/programs/regedit/tests/regedit.c
+++ b/programs/regedit/tests/regedit.c
@@ -3679,7 +3679,7 @@ static void test_export(void)
     verify_reg(hkey, "Wine4a", REG_DWORD, &dword, sizeof(dword), 0);
     verify_reg(hkey, "Wine4b", REG_SZ, "\0\0\0\0\0\0\0", 4, 0);
     verify_reg(hkey, "Wine4c", REG_SZ, "Value", 6, 0);
-    verify_reg(hkey, "Wine4d", REG_SZ, "\0abc", 5, TODO_REG_SIZE);
+    verify_reg(hkey, "Wine4d", REG_SZ, "\0abc", 5, 0);
     dword = 0x100;
     verify_reg(hkey, "Wine4e", REG_DWORD, &dword, sizeof(dword), 0);
     verify_reg(hkey, "Wine4f", REG_SZ, "\0Value", 7, 0);




More information about the wine-cvs mailing list