diff options
author | Volker Lendecke <vl@samba.org> | 2009-01-14 12:58:38 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-01-14 17:08:39 +0100 |
commit | 15dd11b31eac52ffe216efc60129980c9fc3f052 (patch) | |
tree | c81b4e919ba0f3a62a7bad369829aaae3ab46b0f /source3/rpc_client | |
parent | 274f575b2419800ef1a69f303088711eebb73b1a (diff) | |
download | samba-15dd11b31eac52ffe216efc60129980c9fc3f052.tar.gz samba-15dd11b31eac52ffe216efc60129980c9fc3f052.tar.bz2 samba-15dd11b31eac52ffe216efc60129980c9fc3f052.zip |
Remove an unnecessary size check
rpc_read is only ever called with at most fraglen-RPC_HEADER_SIZE length
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 0a208bae36..d9a94556b2 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -255,16 +255,15 @@ static bool rpc_grow_buffer(prs_struct *pdu, size_t size) static NTSTATUS rpc_read(struct rpc_pipe_client *cli, prs_struct *current_pdu, - uint32 data_to_read, + size_t size, uint32 *current_pdu_offset) { - size_t size = (size_t)cli->max_recv_frag; uint32 stream_offset = 0; ssize_t num_read = 0; char *pdata; DEBUG(5, ("rpc_read: data_to_read: %u current_pdu offset: %d\n", - (unsigned int)data_to_read, + (unsigned int)size, (unsigned int)*current_pdu_offset)); pdata = prs_data_p(current_pdu) + *current_pdu_offset; @@ -272,11 +271,6 @@ static NTSTATUS rpc_read(struct rpc_pipe_client *cli, do { NTSTATUS status; - /* read data using SMBreadX */ - if (size > (size_t)data_to_read) { - size = (size_t)data_to_read; - } - switch (cli->transport_type) { case NCACN_NP: status = rpc_read_np(cli->trans.np.cli, @@ -301,11 +295,11 @@ static NTSTATUS rpc_read(struct rpc_pipe_client *cli, return NT_STATUS_INTERNAL_ERROR; } - data_to_read -= num_read; + size -= num_read; stream_offset += num_read; pdata += num_read; - } while (num_read > 0 && data_to_read > 0); + } while (num_read > 0 && size > 0); /* && err == (0x80000000 | STATUS_BUFFER_OVERFLOW)); */ /* |