s4:kdc: Use talloc_get_type_abort()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 17 May 2023 03:05:44 +0000 (15:05 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 18 May 2023 04:53:29 +0000 (04:53 +0000)
We dereference this pointer immediately after this call, so we should be
sure it is not NULL.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/hdb-samba4.c

index 011cd0fd65ae754e635be0a9360d2146bfc500b1..fbce6cc03f41436d51898da4b0e2a0f5edac0068 100644 (file)
@@ -618,8 +618,8 @@ static krb5_error_code hdb_samba4_audit(krb5_context context,
        default:
        {
                TALLOC_CTX *frame = talloc_stackframe();
-               struct samba_kdc_entry *p = talloc_get_type(entry->context,
-                                                           struct samba_kdc_entry);
+               struct samba_kdc_entry *p = talloc_get_type_abort(entry->context,
+                                                                 struct samba_kdc_entry);
                struct dom_sid *sid
                        = samdb_result_dom_sid(frame, p->msg, "objectSid");
                const char *account_name