[KERNEL32] Check the return buffer for NULL before initializing the unicode string buffer with it. By Peter Hater. CORE-11368

svn path=/trunk/; revision=71947
This commit is contained in:
Amine Khaldi 2016-07-15 20:18:20 +00:00
parent 0d440c625d
commit 4d6c550bad

View file

@ -263,8 +263,15 @@ GetComputerNameExA(COMPUTER_NAME_FORMAT NameType,
UNICODE_STRING UnicodeString;
ANSI_STRING AnsiString;
BOOL Result;
PWCHAR TempBuffer = RtlAllocateHeap( RtlGetProcessHeap(), 0, *nSize * sizeof(WCHAR) );
PWCHAR TempBuffer;
if (!lpBuffer)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
TempBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, *nSize * sizeof(WCHAR));
if (!TempBuffer)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);