summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-02 00:34:42 +0200
committerSimo Sorce <idra@samba.org>2010-07-08 00:53:01 -0400
commite8e2fa586b81ddfe45e6751fafcce85842423eed (patch)
tree7a063100e00a640b881cd3ca23dcd0219bc58837 /source3
parentdbeaa5efc7ccbf52fd54e18c0cf7683a8fbc2cd4 (diff)
downloadsamba-e8e2fa586b81ddfe45e6751fafcce85842423eed.tar.gz
samba-e8e2fa586b81ddfe45e6751fafcce85842423eed.tar.bz2
samba-e8e2fa586b81ddfe45e6751fafcce85842423eed.zip
s3-dcerpc: use dcerpc_pull_ncacn_packet() in cli_pipe_validate_current_pdu().
Guenther Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 8f74488eb9..e793575c26 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -1164,11 +1164,19 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli,
case DCERPC_PKT_RESPONSE:
{
- RPC_HDR_RESP rhdr_resp;
uint8 ss_padding_len = 0;
+ DATA_BLOB blob;
+ struct ncacn_packet r;
+
+ blob = data_blob_const(prs_data_p(current_pdu),
+ prs_data_size(current_pdu));
+
+ ret = dcerpc_pull_ncacn_packet(cli, &blob, &r);
+ if (!NT_STATUS_IS_OK(ret)) {
+ return ret;
+ }
- if(!smb_io_rpc_hdr_resp("rpc_hdr_resp", &rhdr_resp, current_pdu, 0)) {
- DEBUG(5,("cli_pipe_validate_current_pdu: failed to unmarshal RPC_HDR_RESP.\n"));
+ if (!prs_set_offset(current_pdu, prs_offset(current_pdu) + RPC_HDR_RESP_LEN)) {
return NT_STATUS_BUFFER_TOO_SMALL;
}
@@ -1206,11 +1214,11 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli,
* set up the return_data parse_struct to the correct size.
*/
- if ((prs_data_size(return_data) == 0) && rhdr_resp.alloc_hint && (rhdr_resp.alloc_hint < 15*1024*1024)) {
- if (!prs_set_buffer_size(return_data, rhdr_resp.alloc_hint)) {
+ if ((prs_data_size(return_data) == 0) && r.u.response.alloc_hint && (r.u.response.alloc_hint < 15*1024*1024)) {
+ if (!prs_set_buffer_size(return_data, r.u.response.alloc_hint)) {
DEBUG(0,("cli_pipe_validate_current_pdu: reply alloc hint %u "
"too large to allocate\n",
- (unsigned int)rhdr_resp.alloc_hint ));
+ (unsigned int)r.u.response.alloc_hint ));
return NT_STATUS_NO_MEMORY;
}
}