]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Fix clang-tidy error in db-glue.c
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 16 Jul 2025 23:47:39 +0000 (11:47 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 29 Jul 2025 04:30:34 +0000 (04:30 +0000)
../../source4/kdc/db-glue.c:968:14: warning: Access to field 'kvno' results in a dereference of a null pointer (loaded from variable 'entry') [clang-analyzer-core.NullDereference]
  968 |         entry->kvno = returned_kvno;
      |         ~~~~~       ^
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/kdc/db-glue.c

index 98b90e3637e3a20d41aafb8d9dec504c01125e3f..5bfc41b66811ce7c50642fc490b0881d95d47608 100644 (file)
@@ -656,6 +656,11 @@ krb5_error_code samba_kdc_message2entry_keys(krb5_context context,
 
        *supported_enctypes_out = 0;
 
+       if (entry == NULL) {
+               DBG_ERR("entry is NULL");
+               return EINVAL;
+       }
+
        /* Is this the krbtgt or a RODC krbtgt */
        if (is_rodc) {
                krbtgt_number = ldb_msg_find_attr_as_int(msg, "msDS-SecondaryKrbTgtNumber", -1);