[KERNEL32]
authorDmitry Chapyshev <dmitry@reactos.org>
Tue, 30 Aug 2016 17:36:01 +0000 (17:36 +0000)
committerDmitry Chapyshev <dmitry@reactos.org>
Tue, 30 Aug 2016 17:36:01 +0000 (17:36 +0000)
- Initialization of a string before obtaining information

* Fixes 2 tests for kernel32_apitest GetComputerNameEx (all tests passed now)

svn path=/trunk/; revision=72511

reactos/dll/win32/kernel32/client/compname.c

index 3bed83d..a336eaa 100644 (file)
@@ -50,6 +50,9 @@ GetComputerNameFromRegistry(LPWSTR RegistryKey,
     ULONG ReturnSize;
     NTSTATUS Status;
 
+    if (lpBuffer != NULL && *nSize > 0)
+        lpBuffer[0] = 0;
+
     RtlInitUnicodeString(&KeyName, RegistryKey);
     InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,