Author: cwittich
Date: Sun Sep 7 09:04:18 2008
New Revision: 36032
URL:
http://svn.reactos.org/svn/reactos?rev=36032&view=rev
Log:
properly zero terminate the buffer in GetComputerName
Modified:
trunk/reactos/dll/win32/kernel32/misc/computername.c
Modified: trunk/reactos/dll/win32/kernel32/misc/computername.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/co…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/computername.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/computername.c [iso-8859-1] Sun Sep 7 09:04:18
2008
@@ -94,9 +94,8 @@
}
if( *nSize > (KeyInfo->DataLength / sizeof(WCHAR)) ) {
- *nSize = KeyInfo->DataLength / sizeof(WCHAR);
+ *nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1;
lpBuffer[*nSize] = 0;
- (*nSize)--;
}
RtlCopyMemory (lpBuffer,