]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
hdb: Initialise HDB structure
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 8 Dec 2021 03:42:32 +0000 (16:42 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 Dec 2021 02:47:27 +0000 (02:47 +0000)
Additional fields may be added to this structure without us explicitly
initialising them. This could cause Heimdal to crash upon reading
garbage data, so we should zero-initialise the structure.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec  9 02:47:27 UTC 2021 on sn-devel-184

source4/kdc/hdb-samba4.c

index f0939193ad78227c93d75792f9cab816c4c437b2..92bc5ff28a69fa0a6f6dcf3d9cf588f8cc6f3d8b 100644 (file)
@@ -530,7 +530,7 @@ NTSTATUS hdb_samba4_create_kdc(struct samba_kdc_base_context *base_ctx,
                return NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION;
        }
 
-       *db = talloc(base_ctx, HDB);
+       *db = talloc_zero(base_ctx, HDB);
        if (!*db) {
                krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
                return NT_STATUS_NO_MEMORY;