From: Stefan Metzmacher Date: Wed, 15 Aug 2012 12:43:40 +0000 (+0200) Subject: s3:smb2_server: do calculations based on SMBD_SMB2_NUM_IOV_PER_REQ in smbd_smb2_reque... X-Git-Tag: tevent-0.9.17~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b596a116fd006bdc78bccef4dc5b9c9ad2807365;p=thirdparty%2Fsamba.git s3:smb2_server: do calculations based on SMBD_SMB2_NUM_IOV_PER_REQ in smbd_smb2_request_validate() metze --- diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index a84776afbad..97739e5bd82 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