summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-15 14:43:40 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-15 14:45:04 +0200
commitb596a116fd006bdc78bccef4dc5b9c9ad2807365 (patch)
treece09270e76d5125ed63884178234941ee60d6bbd /source3
parent7ffee47bc6cc2039a32a527e19e4a76c257fc6b0 (diff)
downloadsamba-b596a116fd006bdc78bccef4dc5b9c9ad2807365.tar.gz
samba-b596a116fd006bdc78bccef4dc5b9c9ad2807365.tar.bz2
samba-b596a116fd006bdc78bccef4dc5b9c9ad2807365.zip
s3:smb2_server: do calculations based on SMBD_SMB2_NUM_IOV_PER_REQ in smbd_smb2_request_validate()
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index a84776afba..97739e5bd8 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -648,7 +648,7 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
}
flags = IVAL(inhdr, SMB2_HDR_FLAGS);
- if (idx == 1) {
+ if (idx < SMBD_SMB2_NUM_IOV_PER_REQ) {
/*
* the 1st request should never have the
* SMB2_HDR_FLAG_CHAINED flag set
@@ -657,7 +657,7 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
req->next_status = NT_STATUS_INVALID_PARAMETER;
return NT_STATUS_OK;
}
- } else if (idx == 4) {
+ } else if (idx < 2*SMBD_SMB2_NUM_IOV_PER_REQ) {
/*
* the 2nd request triggers related vs. unrelated
* compounded requests
@@ -665,7 +665,7 @@ static NTSTATUS smbd_smb2_request_validate(struct smbd_smb2_request *req)
if (flags & SMB2_HDR_FLAG_CHAINED) {
req->compound_related = true;
}
- } else if (idx > 4) {
+ } else {
#if 0
/*
* It seems the this tests are wrong