secur32: Don't try to set an empty target name in schan_InitializeSecurityContextW

Bruno Jesus 00cpxxx at gmail.com
Wed Apr 8 21:54:36 CDT 2015


Based on original patch by Nikos Mavrogiannopoulos with the approach
commented by Jacek Caban.

Fixes bug https://bugs.winehq.org/show_bug.cgi?id=38134
-------------- next part --------------
diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
index 12d4c8d..c6cc4d1 100644
--- a/dlls/secur32/schannel.c
+++ b/dlls/secur32/schannel.c
@@ -825,7 +825,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
             return SEC_E_INTERNAL_ERROR;
         }
 
-        if (pszTargetName)
+        if (pszTargetName && *pszTargetName)
         {
             UINT len = WideCharToMultiByte( CP_UNIXCP, 0, pszTargetName, -1, NULL, 0, NULL, NULL );
             char *target = HeapAlloc( GetProcessHeap(), 0, len );


More information about the wine-patches mailing list