diff --git a/lib/gssapi/krb5/set_cred_option.c b/lib/gssapi/krb5/set_cred_option.c index bd3871675..1411f8665 100644 --- a/lib/gssapi/krb5/set_cred_option.c +++ b/lib/gssapi/krb5/set_cred_option.c @@ -149,8 +149,9 @@ allowed_enctypes(OM_uint32 *minor_status, goto out; } + /* serialized as int32_t[], but stored as krb5_enctype[] */ len = value->length / 4; - enctypes = malloc((len + 1) * 4); + enctypes = malloc((len + 1) * sizeof(krb5_enctype)); if (enctypes == NULL) { *minor_status = ENOMEM; major_stat = GSS_S_FAILURE; @@ -165,9 +166,9 @@ allowed_enctypes(OM_uint32 *minor_status, } for (i = 0; i < len; i++) { - uint32_t e; + int32_t e; - ret = krb5_ret_uint32(sp, &e); + ret = krb5_ret_int32(sp, &e); if (ret) { *minor_status = ret; major_stat = GSS_S_FAILURE; @@ -175,7 +176,7 @@ allowed_enctypes(OM_uint32 *minor_status, } enctypes[i] = e; } - enctypes[i] = 0; + enctypes[i] = KRB5_ENCTYPE_NULL; if (cred->enctypes) free(cred->enctypes); diff --git a/lib/gssapi/mech/gss_krb5.c b/lib/gssapi/mech/gss_krb5.c index 4f16761e8..4416d5181 100644 --- a/lib/gssapi/mech/gss_krb5.c +++ b/lib/gssapi/mech/gss_krb5.c @@ -433,7 +433,7 @@ GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status, gss_cred_id_t cred, OM_uint32 num_enctypes, - krb5_enctype *enctypes) + int32_t *enctypes) { krb5_error_code ret; OM_uint32 maj_status;