mirror of
https://github.com/reactos/reactos.git
synced 2024-10-24 23:11:33 +00:00
properly zero terminate the buffer in GetComputerName
svn path=/trunk/; revision=36032
This commit is contained in:
parent
d2b37f54df
commit
90cdd4f331
|
@ -94,9 +94,8 @@ static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey,
|
||||||
}
|
}
|
||||||
|
|
||||||
if( *nSize > (KeyInfo->DataLength / sizeof(WCHAR)) ) {
|
if( *nSize > (KeyInfo->DataLength / sizeof(WCHAR)) ) {
|
||||||
*nSize = KeyInfo->DataLength / sizeof(WCHAR);
|
*nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1;
|
||||||
lpBuffer[*nSize] = 0;
|
lpBuffer[*nSize] = 0;
|
||||||
(*nSize)--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlCopyMemory (lpBuffer,
|
RtlCopyMemory (lpBuffer,
|
||||||
|
|
Loading…
Reference in a new issue