From e15214767f7711f79b22bf8743c53a419859a903 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 19 Dec 2003 06:53:24 +0000 Subject: [PATCH] ticket 2049 fix an incorrect level of indirection for a krb5_creds data structure. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15942 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/ChangeLog | 5 +++++ src/lib/krb5/ccache/cc_mslsa.c | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lib/krb5/ccache/ChangeLog b/src/lib/krb5/ccache/ChangeLog index 5eab3ca8d..71158eaf3 100644 --- a/src/lib/krb5/ccache/ChangeLog +++ b/src/lib/krb5/ccache/ChangeLog @@ -1,3 +1,8 @@ +2003-12-19 Jeffrey Altman + + * cc_mslsa.c: fix indirection of a krb5_creds structure which + is passed into MSCredToMITCred(). + 2003-12-18 Jeffrey Altman * cc_retr.c: Extract the test to determine if a credential matches diff --git a/src/lib/krb5/ccache/cc_mslsa.c b/src/lib/krb5/ccache/cc_mslsa.c index 464fd9527..6d1dfc5a4 100644 --- a/src/lib/krb5/ccache/cc_mslsa.c +++ b/src/lib/krb5/ccache/cc_mslsa.c @@ -1299,7 +1299,9 @@ krb5_lcc_retrieve(krb5_context context, krb5_ccache id, krb5_flags whichfields, krb5_lcc_data *data = (krb5_lcc_data *)id->data; KERB_EXTERNAL_TICKET *msticket = 0; krb5_creds * mcreds_noflags; - krb5_creds * fetchcreds; + krb5_creds fetchcreds; + + memset(&fetchcreds, 0, sizeof(krb5_creds)); /* first try to find out if we have an existing ticket which meets the requirements */ kret = krb5_cc_retrieve_cred_default (context, id, whichfields, mcreds, creds); @@ -1335,15 +1337,15 @@ krb5_lcc_retrieve(krb5_context context, krb5_ccache id, krb5_flags whichfields, } /* convert the ticket */ - MSCredToMITCred(msticket, context, fetchcreds); + MSCredToMITCred(msticket, context, &fetchcreds); /* check to see if this ticket matches the request using logic from * krb5_cc_retrieve_cred_default() */ - if ( krb5int_cc_creds_match_request(context, whichfields, mcreds, fetchcreds) ) { - creds = fetchcreds; + if ( krb5int_cc_creds_match_request(context, whichfields, mcreds, &fetchcreds) ) { + *creds = fetchcreds; } else { - krb5_free_creds(context, fetchcreds); + krb5_free_cred_contents(context, &fetchcreds); kret = KRB5_CC_NOTFOUND; } -- 2.26.2