From b01fe66069105b2e3c24579d279737edb9564758 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Tue, 17 May 2011 21:17:59 -0700 Subject: [PATCH] Use right variable with comparing lengths. Patch orignally from Jaideep Padhye --- lib/gssapi/spnego/accept_sec_context.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/gssapi/spnego/accept_sec_context.c b/lib/gssapi/spnego/accept_sec_context.c index 2d0b9e1a8..45777a4fe 100644 --- a/lib/gssapi/spnego/accept_sec_context.c +++ b/lib/gssapi/spnego/accept_sec_context.c @@ -413,10 +413,6 @@ acceptor_complete(OM_uint32 * minor_status, { OM_uint32 ret; int require_mic, verify_mic; - gss_buffer_desc buf; - - buf.length = 0; - buf.value = NULL; ret = _gss_spnego_require_mechlist_mic(minor_status, ctx, &require_mic); if (ret) @@ -450,10 +446,8 @@ acceptor_complete(OM_uint32 * minor_status, *minor_status = eret; return GSS_S_FAILURE; } - if (buf.length != buf_len) { - abort(); - UNREACHABLE(return GSS_S_FAILURE); - } + heim_assert(mech_buf->length == buf_len, "Internal ASN.1 error"); + UNREACHABLE(return GSS_S_FAILURE); } if (verify_mic) { @@ -461,15 +455,10 @@ acceptor_complete(OM_uint32 * minor_status, if (ret) { if (*get_mic) send_reject (minor_status, output_token); - if (buf.value) - free(buf.value); return ret; } ctx->verified_mic = 1; } - if (buf.value) - free(buf.value); - } else *get_mic = 0;