Module: wine Branch: master Commit: 697955c922765214d61965ecc594e256853f6d12 URL: http://source.winehq.org/git/wine.git/?a=commit;h=697955c922765214d61965ecc5...
Author: Rob Shearman robertshearman@gmail.com Date: Tue Dec 29 19:06:43 2009 +0000
secur32: Don't allocate context handle in wrapper InitializeSecurityContextA/W if it is the same as the handle passed into the function.
---
dlls/secur32/wrapper.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/secur32/wrapper.c b/dlls/secur32/wrapper.c index 2ab241d..3d678a5 100644 --- a/dlls/secur32/wrapper.c +++ b/dlls/secur32/wrapper.c @@ -283,7 +283,8 @@ SECURITY_STATUS WINAPI InitializeSecurityContextA( cred, ctxt, pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, phNewContext ? &myCtxt : NULL, pOutput, pfContextAttr, ptsExpiry); - if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && phNewContext) + if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && + phNewContext && phNewContext != phContext) { SECURITY_STATUS ret2; ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt); @@ -346,7 +347,8 @@ SECURITY_STATUS WINAPI InitializeSecurityContextW( cred, ctxt, pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, phNewContext ? &myCtxt : NULL, pOutput, pfContextAttr, ptsExpiry); - if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && phNewContext) + if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && + phNewContext && phNewContext != phContext) { SECURITY_STATUS ret2; ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt);