From 779ba0d22198225241ecdb869dc603c201482a71 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Tue, 30 Aug 2016 17:36:01 +0000 Subject: [PATCH] [KERNEL32] - 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/dll/win32/kernel32/client/compname.c b/reactos/dll/win32/kernel32/client/compname.c index 3bed83dac3d..a336eaa9546 100644 --- a/reactos/dll/win32/kernel32/client/compname.c +++ b/reactos/dll/win32/kernel32/client/compname.c @@ -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,