From 5abb68c891f14900b881238ce8ff251e479b5d4f Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Mon, 7 Jan 2019 18:07:53 +1100 Subject: [PATCH] hdb: ensure Salt is zero'd in add_default_salts() Ensure Salt is zero'd in add_default_salts(), as the structure has members other than the salt type and value. --- lib/hdb/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hdb/common.c b/lib/hdb/common.c index ad48cd655..741956bea 100644 --- a/lib/hdb/common.c +++ b/lib/hdb/common.c @@ -123,7 +123,7 @@ add_default_salts(krb5_context context, HDB *db, hdb_entry *entry) _krb5_enctype_requires_random_salt(context, key->key.keytype)) continue; - key->salt = malloc(sizeof(*key->salt)); + key->salt = calloc(1, sizeof(*key->salt)); if (key->salt == NULL) { ret = krb5_enomem(context); break;