]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netlogon: Fix potential use of uninitialized variable
authorDavid Disseldorp <ddiss@samba.org>
Fri, 12 Jul 2019 15:29:23 +0000 (17:29 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 26 Jul 2019 01:48:27 +0000 (01:48 +0000)
The _netr_NetrEnumerateTrustedDomains()->dcerpc_lsa_open_policy2() error
path checks the policy handle and closes it if non-empty. The policy
handle may be uninitialized in this code-path - fix this.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_server/netlogon/srv_netlog_nt.c

index 791aa7acaff2e29f3a2e95d158e526d4e51e3b99..08bce367bf03002a8f7fc792c7ec2b915ec86469 100644 (file)
@@ -419,6 +419,7 @@ NTSTATUS _netr_NetrEnumerateTrustedDomains(struct pipes_struct *p,
        int i;
        uint32_t max_size = (uint32_t)-1;
 
+       ZERO_STRUCT(pol);
        DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
 
        status = rpcint_binding_handle(p->mem_ctx,