don't crash when GetUserNameW is called with NULL - fixes launching of Office 2003 setup

svn path=/trunk/; revision=31875
This commit is contained in:
Christoph von Wittich 2008-01-18 17:54:09 +00:00
parent f1b7277633
commit 126214d889

View file

@ -938,8 +938,11 @@ LookupAccountSidW (
else
{
*pdwAccountName = dwSrcLen;
RtlCopyMemory ( pAccountName, TranslatedName->Name.Buffer, TranslatedName->Name.Length );
pAccountName[TranslatedName->Name.Length / sizeof(WCHAR)] = L'\0';
if (pAccountName)
{
RtlCopyMemory ( pAccountName, TranslatedName->Name.Buffer, TranslatedName->Name.Length );
pAccountName[TranslatedName->Name.Length / sizeof(WCHAR)] = L'\0';
}
}
if ( peUse )
*peUse = TranslatedName->Use;