From: Stefan Metzmacher Date: Tue, 28 Aug 2018 14:30:17 +0000 (+0200) Subject: s4:rpc_server/netlogon: make use of talloc_zero_array() for the netr_OneDomainInfo... X-Git-Tag: samba-4.8.6~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73e383f212af7d17838ba18ec2811267f302fc30;p=thirdparty%2Fsamba.git s4:rpc_server/netlogon: make use of talloc_zero_array() for the netr_OneDomainInfo array It's much safer than having uninitialized memory when we hit an error case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit ef0b489ad0d93199e08415dd895da5cfe2d1c11a) --- diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 42558e9890b..32bf1c8c007 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -2548,7 +2548,7 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal } domain_info->trusted_domain_count = ret3 + 1; - domain_info->trusted_domains = talloc_array(mem_ctx, + domain_info->trusted_domains = talloc_zero_array(mem_ctx, struct netr_OneDomainInfo, domain_info->trusted_domain_count); NT_STATUS_HAVE_NO_MEMORY(domain_info->trusted_domains);