From 1fe281e25708b999a3e9ef1d5808a79995fbb438 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 10 Nov 2009 11:04:08 +0100 Subject: [PATCH 1/2] s3-rpc_client: protect rpc_pipe_np_smb_conn against a NULL struct rpc_pipe_client. Guenther Part of a fix for bug #6697. --- source/rpc_client/cli_pipe.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c index be84c39..6a5802e 100644 --- a/source/rpc_client/cli_pipe.c +++ b/source/rpc_client/cli_pipe.c @@ -2348,6 +2348,9 @@ bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]) struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p) { + if (p == NULL) { + return NULL; + } if (p->transport_type == NCACN_NP) { return p->trans.np.cli; } -- 1.6.2.5 From b6f1eced1f88b747c4cc8077ebf6bf4370100e09 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 10 Nov 2009 13:10:12 +0100 Subject: [PATCH 2/2] s3-rpc_client: make sure cli_rpc_pipe_open_schannel() does not always return NT_STATUS_OK. Guenther Part of a fix for bug #6697. And hopefully a fix for bug #6889. --- source/rpc_client/cli_pipe.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c index 6a5802e..88bd4be 100644 --- a/source/rpc_client/cli_pipe.c +++ b/source/rpc_client/cli_pipe.c @@ -3372,6 +3372,8 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, struct rpc_pipe_client *result = NULL; NTSTATUS status; + *presult = NULL; + status = get_schannel_session_key(cli, domain, &neg_flags, &netlogon_pipe); if (!NT_STATUS_IS_OK(status)) { @@ -3392,7 +3394,7 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, *presult = result; } - return NT_STATUS_OK; + return status; } /**************************************************************************** -- 1.6.2.5