]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix kdcpreauth counting bug 293/head
authorGreg Hudson <ghudson@mit.edu>
Thu, 9 Jul 2015 05:00:40 +0000 (01:00 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 9 Jul 2015 18:37:54 +0000 (14:37 -0400)
In kdc_preauth.c, commit be20a5f5cee8d6c4072d1b81712520dbf9f6eefd made
load_preauth_plugins() handle negative preauth type numbers.
get_plugin_vtables() also needs to handle negative preauth type
numbers, or it can return the wrong count and load_preauth_plugins()
can overflow the table.

ticket: 8200

src/kdc/kdc_preauth.c

index 34775f36ce4bbe79c098f7cde9a637bde2fa1541..e121c5d42b3dca2090f8e019e02ef2a67fc33434 100644 (file)
@@ -235,7 +235,7 @@ get_plugin_vtables(krb5_context context,
             n_tables++;
     }
     for (i = 0, n_systems = 0; i < n_tables; i++) {
-        for (count = 0; vtables[i].pa_type_list[count] > 0; count++);
+        for (count = 0; vtables[i].pa_type_list[count] != 0; count++);
         n_systems += count;
     }
     *vtables_out = vtables;