From 625b52e68eca72ea39e29374e6d9ae32994b186c Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 17 May 2003 01:51:53 +0000 Subject: [PATCH] * ser_ctx.c (krb5_context_internalize): Copy read-in OS context data into krb5_context and free up the newly allocated OS context. ticket: 1497 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15453 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 6 ++++++ src/lib/krb5/krb/ser_ctx.c | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 14026dc28..6222799ed 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +2003-05-16 Ken Raeburn + + * ser_ctx.c (krb5_context_internalize): Copy read-in OS context + data into krb5_context and free up the newly allocated OS + context. + 2003-05-13 Sam Hartman * fwd_tgt.c (krb5_fwd_tgt_creds): Try with no specified enctype if diff --git a/src/lib/krb5/krb/ser_ctx.c b/src/lib/krb5/krb/ser_ctx.c index 014d232e7..d48f61e83 100644 --- a/src/lib/krb5/krb/ser_ctx.c +++ b/src/lib/krb5/krb/ser_ctx.c @@ -461,12 +461,22 @@ krb5_context_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octet * goto cleanup; context->scc_default_format = (int) ibuf; - /* Attempt to read in the os_context */ - kret = krb5_internalize_opaque(kcontext, KV5M_OS_CONTEXT, - (krb5_pointer *) &context->os_context, - &bp, &remain); - if (kret && (kret != EINVAL) && (kret != ENOENT)) - goto cleanup; + /* Attempt to read in the os_context. It's an array now, but + we still treat it in most places as a separate object with + a pointer. */ + { + krb5_os_context osp = 0; + kret = krb5_internalize_opaque(kcontext, KV5M_OS_CONTEXT, + (krb5_pointer *) &osp, + &bp, &remain); + if (kret && (kret != EINVAL) && (kret != ENOENT)) + goto cleanup; + /* Put the newly allocated data into the krb5_context + structure where we're really keeping it these days. */ + if (osp) + *context->os_context = *osp; + free(osp); + } /* Attempt to read in the db_context */ kret = krb5_internalize_opaque(kcontext, KV5M_DB_CONTEXT, -- 2.26.2