From 051eb4863cf880f0349a1de44517f9c99a9c5bd4 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 10 Apr 2013 11:34:41 -0400 Subject: gssd: Fix double free when exporting lucid context When using GSSAPI's gss_krb5_export_lucid_context the context passed into the function is actually deleted during the export (to avoid reuse as the context contains state that depends on its usage). Change the code to pass in a pointer to the context so that it can be properly NULLed if we are using the GSSAPI context and following calls to gss_delete_sec_context will not cause double free errors and segfaults. Signed-off-by: Simo Sorce Signed-off-by: Steve Dickson --- utils/gssd/context_mit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/gssd/context_mit.c') diff --git a/utils/gssd/context_mit.c b/utils/gssd/context_mit.c index e6db9cb..fad6756 100644 --- a/utils/gssd/context_mit.c +++ b/utils/gssd/context_mit.c @@ -152,9 +152,9 @@ typedef struct gss_union_ctx_id_t { } gss_union_ctx_id_desc, *gss_union_ctx_id_t; int -serialize_krb5_ctx(gss_ctx_id_t ctx, gss_buffer_desc *buf, int32_t *endtime) +serialize_krb5_ctx(gss_ctx_id_t *ctx, gss_buffer_desc *buf, int32_t *endtime) { - krb5_gss_ctx_id_t kctx = ((gss_union_ctx_id_t)ctx)->internal_ctx_id; + krb5_gss_ctx_id_t kctx = ((gss_union_ctx_id_t)(*ctx))->internal_ctx_id; char *p, *end; static int constant_zero = 0; static int constant_one = 1; -- cgit