From 7d9fcb46b9f63016bccfd469d1685b72a5756b3f Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Thu, 2 Jun 2016 02:38:04 -0400 Subject: [PATCH] Ensure newly allocated ccache handles are zeroed Otherwise, type-independent fields such as `initialized` have uninitialized values, and incorrect behaviour may result. --- lib/krb5/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/krb5/cache.c b/lib/krb5/cache.c index c4a7fbda8..fb6d24fa4 100644 --- a/lib/krb5/cache.c +++ b/lib/krb5/cache.c @@ -162,8 +162,8 @@ _krb5_cc_allocate(krb5_context context, { krb5_ccache p; - p = malloc (sizeof(*p)); - if(p == NULL) { + p = calloc(1, sizeof(*p)); + if (p == NULL) { krb5_set_error_message(context, KRB5_CC_NOMEM, N_("malloc: out of memory", "")); return KRB5_CC_NOMEM; -- 2.11.4.GIT