1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

s4:kdc: Check that principal being copied is not NULL

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-09-27 13:59:32 +13:00 committed by Joseph Sutton
parent 452aeb218d
commit af22a6552d

View File

@ -210,11 +210,13 @@ int sdb_entry_to_hdb_entry(krb5_context context,
*h = (hdb_entry) {};
rc = krb5_copy_principal(context,
s->principal,
&h->principal);
if (rc != 0) {
return rc;
if (s->principal != NULL) {
rc = krb5_copy_principal(context,
s->principal,
&h->principal);
if (rc != 0) {
return rc;
}
}
h->kvno = s->kvno;