]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Check that principal being copied is not NULL
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 27 Sep 2023 00:59:32 +0000 (13:59 +1300)
committerJoseph Sutton <jsutton@samba.org>
Sun, 1 Oct 2023 22:45:38 +0000 (22:45 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/sdb_to_hdb.c

index 6609bc6d803b709d58638c703141d6d2b6065bfd..a42d460a7687985bdf0de4faabd0e0a4a2bab531 100644 (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;