From 90cdd4f3316082b8b8956a2da25d8d6081a2aeec Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sun, 7 Sep 2008 14:04:18 +0000 Subject: [PATCH] properly zero terminate the buffer in GetComputerName svn path=/trunk/; revision=36032 --- reactos/dll/win32/kernel32/misc/computername.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/computername.c b/reactos/dll/win32/kernel32/misc/computername.c index b79e0e28a33..38eac00fe80 100644 --- a/reactos/dll/win32/kernel32/misc/computername.c +++ b/reactos/dll/win32/kernel32/misc/computername.c @@ -94,9 +94,8 @@ static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey, } if( *nSize > (KeyInfo->DataLength / sizeof(WCHAR)) ) { - *nSize = KeyInfo->DataLength / sizeof(WCHAR); + *nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1; lpBuffer[*nSize] = 0; - (*nSize)--; } RtlCopyMemory (lpBuffer,