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

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Hugh McMaster 2018-04-23 13:37:28 +00:00 committed by Alexandre Julliard
parent 829c0ced69
commit 65717d6726
2 changed files with 3 additions and 2 deletions

View File

@ -409,7 +409,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)
{

View File

@ -4668,7 +4668,7 @@ static void test_export(void)
err = RegQueryValueExA(hkey, "Wine4d", NULL, &type, (BYTE *)&buffer, &size);
ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
ok(type == REG_SZ, "got wrong type %u, expected %u\n", type, REG_SZ);
todo_wine ok(size == 5 || broken(size == 4) /* WinXP */, "got wrong size %u, expected 5\n", size);
ok(size == 5 || broken(size == 4) /* WinXP */, "got wrong size %u, expected 5\n", size);
ok(memcmp(buffer, "\0abc", size) == 0, "got wrong data\n");
dword = 0x100;
verify_reg(hkey, "Wine4e", REG_DWORD, &dword, sizeof(dword), 0);