From fcafe31f429ed0e68f0f7ebd3ec3d24b3d3db06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 3 Oct 2014 15:11:31 +0000 Subject: [PATCH] [MKHIVE] Misc fixes: - add missing initialization - support trailing backslash at end of registry key name CORE-8584 #resolve svn path=/trunk/; revision=64501 --- reactos/tools/mkhive/registry.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reactos/tools/mkhive/registry.c b/reactos/tools/mkhive/registry.c index 7b6359bbf47..c87b684acac 100644 --- a/reactos/tools/mkhive/registry.c +++ b/reactos/tools/mkhive/registry.c @@ -88,6 +88,8 @@ CreateInMemoryStructure( free(Key); return NULL; } + Key->KeyCell->SubKeyLists[Stable] = HCELL_NIL; + Key->KeyCell->SubKeyLists[Volatile] = HCELL_NIL; Key->LinkedKey = NULL; return Key; } @@ -136,7 +138,14 @@ RegpOpenOrCreateKey( (USHORT)((ULONG_PTR)End - (ULONG_PTR)LocalKeyName); } else + { RtlInitUnicodeString(&KeyString, LocalKeyName); + if (KeyString.Length == 0) + { + /* Trailing backslash char; we're done */ + break; + } + } /* Redirect from 'CurrentControlSet' to 'ControlSet001' */ if (!strncmpW(LocalKeyName, L"CurrentControlSet", 17) &&