acquire lock in gss_wrap_iov_length()
authorLuke Howard <lukeh@padl.com>
Sat, 2 Oct 2010 20:16:51 +0000 (22:16 +0200)
committerLuke Howard <lukeh@padl.com>
Sat, 2 Oct 2010 20:16:51 +0000 (22:16 +0200)
wrap_iov_length.c

index e1e8ba6..7930693 100644 (file)
@@ -195,9 +195,17 @@ gss_wrap_iov_length(OM_uint32 *minor,
 
     GSSEAP_MUTEX_LOCK(&ctx->mutex);
 
+    if (!CTX_IS_ESTABLISHED(ctx)) {
+        major = GSS_S_NO_CONTEXT;
+        goto cleanup;
+    }
+
     major = gssEapWrapIovLength(minor, ctx, conf_req_flag, qop_req,
                                 conf_state, iov, iov_count);
+    if (GSS_ERROR(major))
+        goto cleanup;
 
+cleanup:
     GSSEAP_MUTEX_UNLOCK(&ctx->mutex);
 
     return major;