From a5b04fe4b51dd3cf53520e161ef90731731a35e9 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Tue, 29 Sep 2009 23:28:47 -0700 Subject: [PATCH] If et.authorization_data is not allocated, make it so. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch from Johan Gadsjö --- kdc/krb5tgs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kdc/krb5tgs.c b/kdc/krb5tgs.c index c3b0aaa89..34ecabf56 100644 --- a/kdc/krb5tgs.c +++ b/kdc/krb5tgs.c @@ -823,10 +823,14 @@ tgs_make_reply(krb5_context context, unsigned int i = 0; /* XXX check authdata */ + if (et.authorization_data == NULL) { - ret = ENOMEM; - krb5_set_error_message(context, ret, "malloc: out of memory"); - goto out; + et.authorization_data = calloc(1, sizeof(*et.authorization_data)); + if (et.authorization_data == NULL) { + ret = ENOMEM; + krb5_set_error_message(context, ret, "malloc: out of memory"); + goto out; + } } for(i = 0; i < auth_data->len ; i++) { ret = add_AuthorizationData(et.authorization_data, &auth_data->val[i]);