From 0f0ad2992eedeb9e75ddd2c122b5a5b291ba4efe Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Mar 2006 14:58:39 +0000 Subject: r14448: * protect against NULL cli_state* pointers in cli_rpc_pipe_open() * Fix inverted logic check for machine accounts in get_md4pw() (This used to be commit a36529535dcb5a262e7627b80fb62a31240dc8ad) --- source3/rpc_client/cli_pipe.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 45b2e96bac..a2e0dab990 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2171,6 +2171,12 @@ static struct rpc_pipe_client *cli_rpc_pipe_open(struct cli_state *cli, int pipe *perr = NT_STATUS_NO_MEMORY; + /* sanity check to protect against crashes */ + + if ( !cli ) { + return NT_STATUS_INVALID_HANDLE; + } + /* The pipe name index must fall within our array */ SMB_ASSERT((pipe_idx >= 0) && (pipe_idx < PI_MAX_PIPES)); -- cgit