]> git.ipfire.org Git - thirdparty/krb5.git/commit
Fix read overflow in KDC sort_pa_data() 747/head
authorGreg Hudson <ghudson@mit.edu>
Fri, 16 Mar 2018 00:27:30 +0000 (20:27 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 19 Mar 2018 19:58:12 +0000 (15:58 -0400)
commitb38e318cea18fd65647189eed64aef83bf1cb772
treee54713737a9a6019ec267f964c11e052596a4d28
parent3e53f7b254c6704ad16942f98d9b222c9e069ef3
Fix read overflow in KDC sort_pa_data()

sort_pa_data() could read past the end of pa_order if all preauth
systems in the table have the PA_REPLACES_KEY flag, causing a
dereference of preauth_systems[-1].  This situation became possible
after commit fea1a488924faa3938ef723feaa1ff12d22a91ff with the
elimination of static_preauth_systems; before that there were always
table entries which did not have PA_REPLACES_KEY set.

Fix this bug by removing the loop to count n_key_replacers, and
instead get the count from the prior loop by stopping once we move all
of the key-replacing modules to the front.
src/kdc/kdc_preauth.c