[WINESYNC] reg: Fail if a system key has a trailing backslash but no subkey path.

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

wine commit id 797520db8f7eb708845891da6f08d3030393d6bc by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
winesync 2022-01-16 21:10:12 +01:00 committed by Thomas Csovcsity
parent f55096783d
commit f42b63fd64
3 changed files with 18 additions and 8 deletions

View file

@ -234,9 +234,6 @@ BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
if (!sane_path(key))
return FALSE;
*path = wcschr(key, '\\');
if (*path) (*path)++;
*root = path_get_rootkey(key);
if (!*root)
{
@ -244,6 +241,19 @@ BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
return FALSE;
}
*path = wcschr(key, '\\');
if (!*path)
return TRUE;
(*path)++;
if (!**path)
{
output_message(STRING_INVALID_SYSTEM_KEY);
return FALSE;
}
return TRUE;
}