secur32: Don't allocate a context handle in AcceptSecurityContext if new and passed in context are the same.

Hans Leidekker hans at codeweavers.com
Mon Oct 16 03:08:49 CDT 2017


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/secur32/wrapper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/secur32/wrapper.c b/dlls/secur32/wrapper.c
index 06a3674589..dba675422d 100644
--- a/dlls/secur32/wrapper.c
+++ b/dlls/secur32/wrapper.c
@@ -399,7 +399,8 @@ SECURITY_STATUS WINAPI AcceptSecurityContext(
                 ret = package->provider->fnTableW.AcceptSecurityContext(
                  cred, phContext ? &myCtxt : NULL, pInput, fContextReq,
                  TargetDataRep, &myCtxt, pOutput, pfContextAttr, ptsExpiry);
-                if (ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED)
+                if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) &&
+                    phNewContext && phNewContext != phContext)
                 {
                     SECURITY_STATUS ret2;
                     ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt);
-- 
2.11.0




More information about the wine-patches mailing list