Author: cwittich
Date: Fri Jan 18 20:54:09 2008
New Revision: 31875
URL:
http://svn.reactos.org/svn/reactos?rev=31875&view=rev
Log:
don't crash when GetUserNameW is called with NULL - fixes launching of Office 2003
setup
Modified:
trunk/reactos/dll/win32/advapi32/sec/misc.c
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c Fri Jan 18 20:54:09 2008
@@ -938,8 +938,11 @@
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;