Bug 15852. There are valid paths where conn->lsa_pipe_tcp->transport is NULL. Protect...
authorRichard Sharpe <richard.sharpe@primarydata.com>
Tue, 20 Jun 2017 19:40:39 +0000 (12:40 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 22 Jun 2017 21:16:46 +0000 (23:16 +0200)
Based on a suggestion from Metze.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12852

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 22 23:16:46 CEST 2017 on sn-devel-144

source3/winbindd/winbindd_cm.c

index 9b5054c49604f7de824591aff0050a8f992cc3ef..b24a5f253f721ff302671f737bf7a3a4e3897447 100644 (file)
@@ -2926,10 +2926,12 @@ static NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
 
        conn = &domain->conn;
 
-       if (conn->lsa_pipe_tcp &&
+       /*
+        * rpccli_is_connected handles more error cases
+        */
+       if (rpccli_is_connected(conn->lsa_pipe_tcp) &&
            conn->lsa_pipe_tcp->transport->transport == NCACN_IP_TCP &&
-           conn->lsa_pipe_tcp->auth->auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY &&
-           rpccli_is_connected(conn->lsa_pipe_tcp)) {
+           conn->lsa_pipe_tcp->auth->auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) {
                goto done;
        }