mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
Always check the max send sizein rpc_api_pipe, not just with DEVELOPER
This commit is contained in:
parent
6d47418bc1
commit
5987c82697
@ -1275,14 +1275,13 @@ static NTSTATUS rpc_api_pipe(struct rpc_pipe_client *cli,
|
|||||||
uint8_t *rdata = NULL;
|
uint8_t *rdata = NULL;
|
||||||
uint8_t *rdata_copy;
|
uint8_t *rdata_copy;
|
||||||
uint32_t rdata_len = 0;
|
uint32_t rdata_len = 0;
|
||||||
uint32 max_data = cli->max_xmit_frag ? cli->max_xmit_frag : RPC_MAX_PDU_FRAG_LEN;
|
|
||||||
uint32 current_rbuf_offset = 0;
|
uint32 current_rbuf_offset = 0;
|
||||||
prs_struct current_pdu;
|
prs_struct current_pdu;
|
||||||
|
|
||||||
#ifdef DEVELOPER
|
if (data_len > cli->max_xmit_frag) {
|
||||||
/* Ensure we're not sending too much. */
|
/* Ensure we're not sending too much. */
|
||||||
SMB_ASSERT(data_len <= max_data);
|
return NT_STATUS_INVALID_PARAMETER;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
/* Set up the current pdu parse struct. */
|
/* Set up the current pdu parse struct. */
|
||||||
prs_init_empty(¤t_pdu, prs_get_mem_context(rbuf), UNMARSHALL);
|
prs_init_empty(¤t_pdu, prs_get_mem_context(rbuf), UNMARSHALL);
|
||||||
@ -1291,9 +1290,7 @@ static NTSTATUS rpc_api_pipe(struct rpc_pipe_client *cli,
|
|||||||
|
|
||||||
ret = cli_api_pipe(talloc_tos(), cli,
|
ret = cli_api_pipe(talloc_tos(), cli,
|
||||||
(uint8_t *)prs_data_p(data), prs_offset(data),
|
(uint8_t *)prs_data_p(data), prs_offset(data),
|
||||||
cli->max_recv_frag
|
cli->max_recv_frag, &rdata, &rdata_len);
|
||||||
? cli->max_recv_frag : RPC_MAX_PDU_FRAG_LEN,
|
|
||||||
&rdata, &rdata_len);
|
|
||||||
if (!NT_STATUS_IS_OK(ret)) {
|
if (!NT_STATUS_IS_OK(ret)) {
|
||||||
DEBUG(5, ("cli_api_pipe failed: %s\n", nt_errstr(ret)));
|
DEBUG(5, ("cli_api_pipe failed: %s\n", nt_errstr(ret)));
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user