From: Joseph Sutton Date: Wed, 8 Dec 2021 03:42:32 +0000 (+1300) Subject: hdb: Initialise HDB structure X-Git-Tag: tdb-1.4.6~422 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b948aeac5398693e0c8c70cbff531965ed7ecd23;p=thirdparty%2Fsamba.git hdb: Initialise HDB structure 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 Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Dec 9 02:47:27 UTC 2021 on sn-devel-184 --- diff --git a/source4/kdc/hdb-samba4.c b/source4/kdc/hdb-samba4.c index f0939193ad7..92bc5ff28a6 100644 --- a/source4/kdc/hdb-samba4.c +++ b/source4/kdc/hdb-samba4.c @@ -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;