From f28b2ac65a58a99e694206522a853cfdc32a5e85 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 5 Aug 2012 15:00:23 +0200 Subject: s3:smb2_write: make use of SMBD_SMB2_* macros metze --- source3/smbd/smb2_write.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c index c649befa87..03998caba1 100644 --- a/source3/smbd/smb2_write.c +++ b/source3/smbd/smb2_write.c @@ -40,7 +40,6 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req) { NTSTATUS status; const uint8_t *inbody; - int i = req->current_idx; uint16_t in_data_offset; uint32_t in_data_length; DATA_BLOB in_data_buffer; @@ -55,7 +54,7 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req) if (!NT_STATUS_IS_OK(status)) { return smbd_smb2_request_error(req, status); } - inbody = (const uint8_t *)req->in.vector[i+1].iov_base; + inbody = SMBD_SMB2_IN_BODY_PTR(req); in_data_offset = SVAL(inbody, 0x02); in_data_length = IVAL(inbody, 0x04); @@ -64,11 +63,11 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req) in_file_id_volatile = BVAL(inbody, 0x18); in_flags = IVAL(inbody, 0x2C); - if (in_data_offset != (SMB2_HDR_BODY + req->in.vector[i+1].iov_len)) { + if (in_data_offset != (SMB2_HDR_BODY + SMBD_SMB2_IN_BODY_LEN(req))) { return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); } - if (in_data_length > req->in.vector[i+2].iov_len) { + if (in_data_length > SMBD_SMB2_IN_DYN_LEN(req)) { return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); } @@ -80,7 +79,7 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req) return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); } - in_data_buffer.data = (uint8_t *)req->in.vector[i+2].iov_base; + in_data_buffer.data = SMBD_SMB2_IN_DYN_PTR(req); in_data_buffer.length = in_data_length; status = smbd_smb2_request_verify_creditcharge(req, in_data_length); -- cgit