From: Jeffrey Altman Date: Wed, 12 Dec 2007 04:25:38 +0000 (+0000) Subject: DEVEL15-windows-afslogon-null-pointer-deref-20071211 X-Git-Tag: openafs-devel-1_5_29~38 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8cf03816462b6b9f71fe28aef5b7e0b265c41737;p=packages%2Fo%2Fopenafs.git DEVEL15-windows-afslogon-null-pointer-deref-20071211 LICENSE MIT 'tokenUser' can be dereferenced when NULL if GetTokenInformation() fails. (cherry picked from commit 8f84815d0d8c9cc0b49eb29bfceeb03a7ae7f04f) --- diff --git a/src/WINNT/afsd/afslogon.c b/src/WINNT/afsd/afslogon.c index f13d9056a..f92f78831 100644 --- a/src/WINNT/afsd/afslogon.c +++ b/src/WINNT/afsd/afslogon.c @@ -1230,7 +1230,7 @@ VOID AFS_Logoff_Event( PWLX_NOTIFICATION_INFO pInfo ) /* We can't use pInfo->Domain for the domain since in the cross realm case * this is source domain and not the destination domain. */ - if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, pInfo->Domain)) { + if (tokenUser && QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, pInfo->Domain)) { WCHAR Domain[64]=L""; GetLocalShortDomain(Domain, sizeof(Domain)); if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, Domain)) { @@ -1342,7 +1342,7 @@ VOID AFS_Logon_Event( PWLX_NOTIFICATION_INFO pInfo ) /* We can't use pInfo->Domain for the domain since in the cross realm case * this is source domain and not the destination domain. */ - if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, pInfo->Domain)) { + if (tokenUser && QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, pInfo->Domain)) { WCHAR Domain[64]=L""; GetLocalShortDomain(Domain, sizeof(Domain)); if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid, Domain)) {