From 51700afd9c51c881e9ffa2e3ba6948903d7eb204 Mon Sep 17 00:00:00 2001 From: Kevin Koltzau Date: Fri, 16 Jul 2004 23:22:09 +0000 Subject: [PATCH] Prevent garbage being passed for windows directory. --- misc/registry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/registry.c b/misc/registry.c index 99161640686..a99e68dc827 100644 --- a/misc/registry.c +++ b/misc/registry.c @@ -1110,10 +1110,12 @@ static void _allocate_default_keys(void) static void get_windows_dir(WCHAR* buffer, unsigned len) { + static const WCHAR windows_dir[] = {'c',':','\\','w','i','n','d','o','w','s',0}; OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW, keyW; HKEY hkey; + *buffer = 0; attr.Length = sizeof(attr); attr.RootDirectory = 0; attr.ObjectName = &nameW; @@ -1139,6 +1141,7 @@ static void get_windows_dir(WCHAR* buffer, unsigned len) } RtlFreeUnicodeString( &nameW ); } + if (!*buffer) lstrcpynW(buffer, windows_dir, len); }