Skip to content

Commit

Permalink
Fix apply_keysalt_policy bug
Browse files Browse the repository at this point in the history
If apply_keysalt_policy is called with null result arguments (as from
kadm5_setkey_principal_3), we would dereference a null pointer if the
principal has no policy or no policy allowed_keysalts field, due to an
incorrect optimization.  Reported by Nico.

ticket: 7223
  • Loading branch information
greghudson committed Aug 15, 2012
1 parent 4f6f91b commit b52d0c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/kadm5/srv/svr_principal.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ apply_keysalt_policy(kadm5_server_handle_t handle, const char *policy,
goto cleanup;
}

if (polent.allowed_keysalts == NULL && new_n_kstp != NULL) {
if (polent.allowed_keysalts == NULL) {
/* Requested keysalts allowed or default to supported_enctypes. */
if (n_ks_tuple == 0) {
/* Default to supported_enctypes. */
Expand Down

0 comments on commit b52d0c7

Please sign in to comment.