Skip to content

Commit

Permalink
Fix krb5_ldap_list_policy() filtering loop
Browse files Browse the repository at this point in the history
The loop at the end of this function is intended to ignore ticket
policy DNs that can't be converted to names.  But it instead leaves a
hole in the output list if that happens, effectively truncating the
list and leaking any subsequent entries.  Use the correct index for
the output list.

ticket: 9148 (new)
  • Loading branch information
greghudson committed Oct 27, 2024
1 parent ff4d99b commit 621c312
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/kdb/ldap/libkdb_ldap/ldap_tkt_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ krb5_ldap_list_policy(krb5_context context, char *containerdn, char ***policy)

for (i = 0, j = 0; list[i] != NULL; i++, j++) {
int ret;
ret = krb5_ldap_policydn_to_name (context, list[i], &(*policy)[i]);
ret = krb5_ldap_policydn_to_name (context, list[i], &(*policy)[j]);
if (ret != 0)
j--;
}
Expand Down

0 comments on commit 621c312

Please sign in to comment.