From 55d479539cf47eb594bbdf31e8c351f74b060cf6 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Tue, 28 Dec 2010 18:27:17 +0000 Subject: [PATCH] Don't attempt to serialize a NULL authdata context when serializing a GSSAPI context (most often seen with initiator contexts). Patch from aberry@likewise.com. ticket: 6675 target_version: 1.9.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24590 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ser_sctx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/gssapi/krb5/ser_sctx.c b/src/lib/gssapi/krb5/ser_sctx.c index 63a7bd82a..ae6350cce 100644 --- a/src/lib/gssapi/krb5/ser_sctx.c +++ b/src/lib/gssapi/krb5/ser_sctx.c @@ -357,7 +357,7 @@ kg_ctx_size(kcontext, arg, sizep) initiator_name = ctx->initiate ? ctx->here : ctx->there; - if (initiator_name) { + if (initiator_name && initiator_name->ad_context) { kret = krb5_size_opaque(kcontext, KV5M_AUTHDATA_CONTEXT, initiator_name->ad_context, @@ -534,7 +534,7 @@ kg_ctx_externalize(kcontext, arg, buffer, lenremain) initiator_name = ctx->initiate ? ctx->here : ctx->there; - if (initiator_name) { + if (initiator_name && initiator_name->ad_context) { kret = krb5_externalize_opaque(kcontext, KV5M_AUTHDATA_CONTEXT, initiator_name->ad_context, @@ -775,6 +775,8 @@ kg_ctx_internalize(kcontext, argp, buffer, lenremain) (krb5_pointer *)&initiator_name->ad_context, &bp, &remain); + if (kret == EINVAL) + kret = 0; } } /* Get trailer */ -- 2.26.2