From: Alexandra Ellwood Date: Fri, 24 Oct 2008 20:54:12 +0000 (+0000) Subject: krb5_build_principal_ext walks off beginning of array X-Git-Tag: krb5-1.7-alpha1~263 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=105843a4d3123d2ce0a668e4512efc974720f2d3;p=krb5.git krb5_build_principal_ext walks off beginning of array On error, krb5_build_principal_ext walks off the beginning of the array by using i-- in a conditional when it should be using --i (so that it actually compares the value of i that will be used below). ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20920 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/bld_pr_ext.c b/src/lib/krb5/krb/bld_pr_ext.c index c7236b7b5..c1e19ba17 100644 --- a/src/lib/krb5/krb/bld_pr_ext.c +++ b/src/lib/krb5/krb/bld_pr_ext.c @@ -93,7 +93,7 @@ krb5_build_principal_ext(krb5_context context, krb5_principal * princ, return 0; free_out: - while (i-- >= 0) + while (--i >= 0) krb5_xfree(princ_data[i].data); krb5_xfree(princ_data); krb5_xfree(princ_ret);