From e1cbf08accafc58d142d18e7f96f21081ab9f291 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Thu, 22 Oct 2009 21:00:19 +0000 Subject: [PATCH] When iterating through the keytab in krb5_rd_req(), do not return success if we did not find any matching keytab entries, otherwise we will crash upon accessing ticket->enc_part2. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22974 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/rd_req_dec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/krb/rd_req_dec.c b/src/lib/krb5/krb/rd_req_dec.c index 0861794dd..8516c7e43 100644 --- a/src/lib/krb5/krb/rd_req_dec.c +++ b/src/lib/krb5/krb/rd_req_dec.c @@ -119,9 +119,11 @@ krb5_rd_req_decrypt_tkt_part(krb5_context context, const krb5_ap_req *req, krb5_error_code code; krb5_kt_cursor cursor; - retval = krb5_kt_start_seq_get(context, keytab, &cursor); - if (retval != 0) + code = krb5_kt_start_seq_get(context, keytab, &cursor); + if (code != 0) { + retval = code; goto map_error; + } while ((code = krb5_kt_next_entry(context, keytab, &ktent, &cursor)) == 0) { -- 2.26.2