From f81717444aa095b44f3badb8903d4df9d38aa25d Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 14 Oct 1997 14:56:58 +0000 Subject: [PATCH] Fix error when number of enctypes comming in is 0 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10227 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/alt_prof.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lib/kadm5/alt_prof.c b/src/lib/kadm5/alt_prof.c index b1b07c5b5..1aad9f944 100644 --- a/src/lib/kadm5/alt_prof.c +++ b/src/lib/kadm5/alt_prof.c @@ -607,11 +607,18 @@ krb5_error_code kadm5_get_config_params(context, kdcprofile, kdcenv, /* Get the value for the supported enctype/salttype matrix */ hierarchy[2] = "supported_enctypes"; if (params_in->mask & KADM5_CONFIG_ENCTYPES) { - params.keysalts = copy_key_salt_tuple(params_in->keysalts, - params_in->num_keysalts); - if(params.keysalts) { - params.mask |= KADM5_CONFIG_ENCTYPES; - params.num_keysalts = params_in->num_keysalts; + /* The following scenario is when the input keysalts are !NULL */ + if(params_in->keysalts) { + params.keysalts = copy_key_salt_tuple(params_in->keysalts, + params_in->num_keysalts); + if(params.keysalts) { + params.mask |= KADM5_CONFIG_ENCTYPES; + params.num_keysalts = params_in->num_keysalts; + } + } else { + params.mask |= KADM5_CONFIG_ENCTYPES; + params.keysalts = 0; + params.num_keysalts = params_in->num_keysalts; } } else { svalue = NULL; -- 2.26.2