From 7d7132afbb45cd73d566bc9d7028086fa4241112 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 30 Mar 2011 15:30:37 +1100 Subject: [PATCH] fix shib reentrancy regression in recent commit --- util_attr.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/util_attr.cpp b/util_attr.cpp index 4d4efde..01c3135 100644 --- a/util_attr.cpp +++ b/util_attr.cpp @@ -1159,9 +1159,11 @@ gssEapCreateAttrContext(OM_uint32 *minor, return major; try { - ctx = new gss_eap_attr_ctx(); + /* Set *pAttrContext here to for reentrancy */ + *pAttrContext = ctx = new gss_eap_attr_ctx(); if (ctx->initWithGssContext(gssCred, gssCtx)) { + *pExpiryTime = ctx->getExpiryTime(); major = GSS_S_COMPLETE; *minor = 0; } else { @@ -1173,13 +1175,10 @@ gssEapCreateAttrContext(OM_uint32 *minor, major = ctx->mapException(minor, e); } - if (major == GSS_S_COMPLETE) { - *pExpiryTime = ctx->getExpiryTime(); - *pAttrContext = ctx; - } - - if (GSS_ERROR(major)) + if (GSS_ERROR(major)) { delete ctx; + *pAttrContext = NULL; + } return major; } -- 2.1.4