Fix getting subkey with trailing or duplacate backslashes (#674)

This PR fixes opening a registry key with trailing or repeating
backslashes.

For example, the following code should open the key without any error:

`RegOpenKeyExW(HKEY_LOCAL_MACHINE,
LR"(SOFTWARE\Microsoft\\Windows\CurrentVersion\\Run\)", 0, KEY_READ,
&hKey);`
This commit is contained in:
Maurice Heumann
2026-01-02 16:52:12 +01:00
committed by GitHub

View File

@@ -107,6 +107,11 @@ class hive_parser
for (const auto& key_part : key)
{
if (key_part.empty())
{
continue;
}
if (!current_key)
{
return nullptr;