mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[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:
parent
0d440c625d
commit
4d6c550bad
1 changed files with 8 additions and 1 deletions
|
@ -263,8 +263,15 @@ GetComputerNameExA(COMPUTER_NAME_FORMAT NameType,
|
||||||
UNICODE_STRING UnicodeString;
|
UNICODE_STRING UnicodeString;
|
||||||
ANSI_STRING AnsiString;
|
ANSI_STRING AnsiString;
|
||||||
BOOL Result;
|
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)
|
if (!TempBuffer)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
Loading…
Reference in a new issue