When iterating through the keytab in krb5_rd_req(), do not
authorLuke Howard <lukeh@padl.com>
Thu, 22 Oct 2009 21:00:19 +0000 (21:00 +0000)
committerLuke Howard <lukeh@padl.com>
Thu, 22 Oct 2009 21:00:19 +0000 (21:00 +0000)
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

index 0861794ddc970d316d3bc8d685d21365ad9dd30f..8516c7e43fe19d98e3605113f8a5b23242ca2cef 100644 (file)
@@ -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) {