Skip to content

Commit

Permalink
hdb: ensure Salt is zero'd in add_default_salts()
Browse files Browse the repository at this point in the history
Ensure Salt is zero'd in add_default_salts(), as the structure has members
other than the salt type and value.
  • Loading branch information
lhoward committed Jan 7, 2019
1 parent ff21a49 commit 5abb68c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hdb/common.c
Expand Up @@ -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;
Expand Down

0 comments on commit 5abb68c

Please sign in to comment.