Add bounds-checking assertions before automatic array reference
authorKen Raeburn <raeburn@mit.edu>
Wed, 11 Oct 2006 04:54:00 +0000 (04:54 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 11 Oct 2006 04:54:00 +0000 (04:54 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18677 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/kdc_util.c

index 071555bd9582a134e271bfe1f06a3eb0936f1e4c..b8ccce30d5354079af13ed5c784433161edeaba0 100644 (file)
@@ -699,6 +699,8 @@ add_to_transited(krb5_data *tgt_trans, krb5_data *new_trans,
       /* subrealm of the next field too, and we will catch     */
       /* it in a future iteration.                             */
 
+      assert(nlst >= 0);
+      assert(nlst < sizeof(next));
       if ((next[nlst] != '.') && (next[0] != '/') &&
           (pl = subrealm(exp, realm))) {
         added = TRUE;