diff options
author | Tim Potter <tpot@samba.org> | 2002-10-17 05:08:34 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-10-17 05:08:34 +0000 |
commit | e7c011412bbec88baa7fa7469bad1132eda5384c (patch) | |
tree | 33f9608726ecf2821844a5445497a848606ee22c | |
parent | 4af2e30ecf31da6dd9ac2763c0743f2f5548d443 (diff) | |
download | samba-e7c011412bbec88baa7fa7469bad1132eda5384c.tar.gz samba-e7c011412bbec88baa7fa7469bad1132eda5384c.tar.bz2 samba-e7c011412bbec88baa7fa7469bad1132eda5384c.zip |
Do a SMB_ASSERT() in cli_nt_session_open() when the pipe index is out
of range instead of silently failing.
(This used to be commit b5111f47b5cf1820550e17663f983674b67bcaff)
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 71e422f251..61c6f2889f 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1253,8 +1253,9 @@ BOOL cli_nt_session_open(struct cli_state *cli, const int pipe_idx) SMB_ASSERT(cli->nt_pipe_fnum == 0); - if ( (pipe_idx < 0) || (pipe_idx >= PI_MAX_PIPES) ) - return False; + /* The pipe index must fall within our array */ + + SMB_ASSERT((pipe_idx >= 0) && (pipe_idx < PI_MAX_PIPES)); if (cli->capabilities & CAP_NT_SMBS) { if ((fnum = cli_nt_create(cli, &pipe_names[pipe_idx].client_pipe[5], DESIRED_ACCESS_PIPE)) == -1) { |