From 967f2c44b3b911d151ea262b748d68654ba9e2fc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 25 Jun 2012 21:14:43 +0200 Subject: s3:smb2_server: simplify smbd_smb2_request_verify_creditcharge() a bit. A credit charge of 0 is really not a special case, it just means the same as 1. metze --- source3/smbd/smb2_server.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index d2300a29f8..a6efdbe686 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1449,12 +1449,7 @@ NTSTATUS smbd_smb2_request_verify_creditcharge(struct smbd_smb2_request *req, inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; credit_charge = SVAL(inhdr, SMB2_HDR_CREDIT_CHARGE); - - /* requests larger than 64 KB need credit charge */ - if (credit_charge == 0 && data_length > 65536) { - DEBUG(2, ("Request larger than 64KB w/o creditcharge\n")); - return NT_STATUS_INVALID_PARAMETER; - } + credit_charge = MAX(credit_charge, 1); needed_charge = (data_length - 1)/ 65536 + 1; -- cgit