hdb: Make HDB-as-keytab get function match API

krb5_kt_get_entry() allows a NULL principal to be given ("match all").

The get method of the HDB-as-keytab keytab did not know this, and could
dereference a NULL as a result.
This commit is contained in:
Nicolas Williams
2022-01-19 23:35:19 -06:00
parent cf19a0f8e3
commit dd2ad50fbf

View File

@@ -190,6 +190,9 @@ hdb_get_entry(krb5_context context,
HDB *db;
size_t i;
if (!principal)
return KRB5_KT_NOTFOUND;
memset(&ent, 0, sizeof(ent));
if (dbname == NULL) {