summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-07 12:30:54 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-07 18:32:45 +0200
commitefaea8e0e1ca389ac7bd82f2d9a3401f92094fe4 (patch)
tree1daffa4d0bc411778c2500cbfc5daf35b133ca77 /source3
parent4e6e1ecb6eb948c9651c6a1e17319c75191a1bac (diff)
downloadsamba-efaea8e0e1ca389ac7bd82f2d9a3401f92094fe4.tar.gz
samba-efaea8e0e1ca389ac7bd82f2d9a3401f92094fe4.tar.bz2
samba-efaea8e0e1ca389ac7bd82f2d9a3401f92094fe4.zip
s3:smb2_server: make use of helper macros in smbd_smb2_request_validate()
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_server.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 4937f4bcbf..2b32407aad 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -590,18 +590,20 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
}
for (idx=1; idx < count; idx += SMBD_SMB2_NUM_IOV_PER_REQ) {
+ struct iovec *hdr = SMBD_SMB2_IDX_HDR_IOV(req,in,idx);
+ struct iovec *body = SMBD_SMB2_IDX_BODY_IOV(req,in,idx);
const uint8_t *inhdr = NULL;
uint32_t flags;
- if (req->in.vector[idx].iov_len != SMB2_HDR_BODY) {
+ if (hdr->iov_len != SMB2_HDR_BODY) {
return NT_STATUS_INVALID_PARAMETER;
}
- if (req->in.vector[idx+1].iov_len < 2) {
+ if (body->iov_len < 2) {
return NT_STATUS_INVALID_PARAMETER;
}
- inhdr = (const uint8_t *)req->in.vector[idx].iov_base;
+ inhdr = (const uint8_t *)hdr->iov_base;
/* Check the SMB2 header */
if (IVAL(inhdr, SMB2_HDR_PROTOCOL_ID) != SMB2_MAGIC) {