Rob Shearman : secur32: Fix ntlm_GetCachedCredential to not call strlenW on a NULL pointer.

Alexandre Julliard julliard at winehq.org
Mon Mar 10 17:05:07 CDT 2008


Module: wine
Branch: master
Commit: 088ae3b81c7387f98c217260484207cbf175e2d6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=088ae3b81c7387f98c217260484207cbf175e2d6

Author: Rob Shearman <rob at codeweavers.com>
Date:   Mon Mar 10 16:41:55 2008 +0000

secur32: Fix ntlm_GetCachedCredential to not call strlenW on a NULL pointer.

pszHost should just be set to pszTargetName if pszTargetName doesn't
contain any other information.

---

 dlls/secur32/ntlm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c
index 5b95d92..f971fc1 100644
--- a/dlls/secur32/ntlm.c
+++ b/dlls/secur32/ntlm.c
@@ -405,7 +405,10 @@ static BOOL ntlm_GetCachedCredential(const SEC_WCHAR *pszTargetName, PCREDENTIAL
             p = pszHost + strlenW(pszHost);
     }
     else /* otherwise not an SPN, just a host */
+    {
+        pszHost = pszTargetName;
         p = pszHost + strlenW(pszHost);
+    }
 
     pszHostOnly = HeapAlloc(GetProcessHeap(), 0, (p - pszHost + 1) * sizeof(WCHAR));
     if (!pszHostOnly)




More information about the wine-cvs mailing list