- Add NULL pointer check. Found by Amine Khaldi.

svn path=/trunk/; revision=43033
This commit is contained in:
Dmitry Chapyshev 2009-09-12 12:04:39 +00:00
parent 6672b72619
commit 2ff9fd5fcf

View file

@ -1200,11 +1200,14 @@ LookupAccountSidW(LPCWSTR pSystemName,
else else
{ {
*pdwDomainName = dwSrcLen; *pdwDomainName = dwSrcLen;
if (pDomainName)
{
RtlCopyMemory ( pDomainName, ReferencedDomain->Domains[0].Name.Buffer, ReferencedDomain->Domains[0].Name.Length ); RtlCopyMemory ( pDomainName, ReferencedDomain->Domains[0].Name.Buffer, ReferencedDomain->Domains[0].Name.Length );
pDomainName[ReferencedDomain->Domains[0].Name.Length / sizeof(WCHAR)] = L'\0'; pDomainName[ReferencedDomain->Domains[0].Name.Length / sizeof(WCHAR)] = L'\0';
} }
} }
} }
}
if ( !ret ) if ( !ret )
SetLastError(ERROR_INSUFFICIENT_BUFFER); SetLastError(ERROR_INSUFFICIENT_BUFFER);