regedit: Stop parsing REG_SZ values containing NUL character sequences.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2021-03-12 22:27:33 +11:00 committed by Alexandre Julliard
parent 87717c9cbf
commit b8b7979f9c
2 changed files with 13 additions and 14 deletions

View File

@ -402,8 +402,7 @@ static BOOL REGPROC_unescape_string(WCHAR *str, WCHAR **unparsed)
str[val_idx] = '\r';
break;
case '0':
str[val_idx] = '\0';
break;
return FALSE;
case '\\':
case '"':
str[val_idx] = str[str_idx];

View File

@ -1694,12 +1694,12 @@ static void test_invalid_import(void)
"\"Wine33d\"=\"Value2\\0\\0\\0\\0\"\n"
"\"Wine33e\"=\"Value3\\0Value4\"\n"
"\"Wine33f\"=\"\\0Value5\"\n\n");
todo_wine verify_reg_nonexist(hkey, "Wine33a");
todo_wine verify_reg_nonexist(hkey, "Wine33b");
todo_wine verify_reg_nonexist(hkey, "Wine33c");
todo_wine verify_reg_nonexist(hkey, "Wine33d");
todo_wine verify_reg_nonexist(hkey, "Wine33e");
todo_wine verify_reg_nonexist(hkey, "Wine33f");
verify_reg_nonexist(hkey, "Wine33a");
verify_reg_nonexist(hkey, "Wine33b");
verify_reg_nonexist(hkey, "Wine33c");
verify_reg_nonexist(hkey, "Wine33d");
verify_reg_nonexist(hkey, "Wine33e");
verify_reg_nonexist(hkey, "Wine33f");
close_key(hkey);
@ -2205,12 +2205,12 @@ static void test_invalid_import_unicode(void)
"\"Wine33d\"=\"Value2\\0\\0\\0\\0\"\n"
"\"Wine33e\"=\"Value3\\0Value4\"\n"
"\"Wine33f\"=\"\\0Value5\"\n\n");
todo_wine verify_reg_nonexist(hkey, "Wine33a");
todo_wine verify_reg_nonexist(hkey, "Wine33b");
todo_wine verify_reg_nonexist(hkey, "Wine33c");
todo_wine verify_reg_nonexist(hkey, "Wine33d");
todo_wine verify_reg_nonexist(hkey, "Wine33e");
todo_wine verify_reg_nonexist(hkey, "Wine33f");
verify_reg_nonexist(hkey, "Wine33a");
verify_reg_nonexist(hkey, "Wine33b");
verify_reg_nonexist(hkey, "Wine33c");
verify_reg_nonexist(hkey, "Wine33d");
verify_reg_nonexist(hkey, "Wine33e");
verify_reg_nonexist(hkey, "Wine33f");
close_key(hkey);