1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Remove an unnecessary size check

rpc_read is only ever called with at most fraglen-RPC_HEADER_SIZE length
This commit is contained in:
Volker Lendecke 2009-01-14 12:58:38 +01:00
parent 274f575b24
commit 15dd11b31e

View File

@ -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)); */
/*