svn rev #25797: trunk/src/lib/krb5/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Mar 30 20:38:20 EDT 2012


http://src.mit.edu/fisheye/changelog/krb5/?cs=25797
Commit By: ghudson
Log Message:
Fix data handling in rd_req_decoded_opt

We shouldn't peer at trans->tr_contents.data[0] if
trans->tr_contents.length is 0, even if the data field is non-null.
Harmless as long as the ASN.1 decoder uses null data fields for empty
krb5_data values, but still wrong.


Changed Files:
U   trunk/src/lib/krb5/krb/rd_req_dec.c
Modified: trunk/src/lib/krb5/krb/rd_req_dec.c
===================================================================
--- trunk/src/lib/krb5/krb/rd_req_dec.c	2012-03-31 00:38:16 UTC (rev 25796)
+++ trunk/src/lib/krb5/krb/rd_req_dec.c	2012-03-31 00:38:20 UTC (rev 25797)
@@ -330,7 +330,7 @@
         krb5_transited *trans = &(req->ticket->enc_part2->transited);
 
         /* If the transited list is empty, then we have at most one hop */
-        if (trans->tr_contents.data && trans->tr_contents.data[0])
+        if (trans->tr_contents.length > 0 && trans->tr_contents.data[0])
             retval = KRB5KRB_AP_ERR_ILL_CR_TKT;
     }
 
@@ -351,7 +351,7 @@
          * So we also have to check that the client's realm is the local one
          */
         krb5_get_default_realm(context, &lrealm);
-        if ((trans->tr_contents.data && trans->tr_contents.data[0]) ||
+        if ((trans->tr_contents.length > 0 && trans->tr_contents.data[0]) ||
             !data_eq_string(*realm, lrealm)) {
             retval = KRB5KRB_AP_ERR_ILL_CR_TKT;
         }
@@ -374,7 +374,7 @@
          * transited are within the hierarchy between the client's realm
          * and the local realm.
          */
-        if (trans->tr_contents.data && trans->tr_contents.data[0]) {
+        if (trans->tr_contents.length > 0 && trans->tr_contents.data[0]) {
             retval = krb5_check_transited_list(context, &(trans->tr_contents),
                                                realm,
                                                krb5_princ_realm (context,server));



More information about the cvs-krb5 mailing list