diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-06-25 21:14:43 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-06-29 00:14:56 +0200 |
commit | 967f2c44b3b911d151ea262b748d68654ba9e2fc (patch) | |
tree | 13060d61c3a2a4dffd2234dacbe5d1ee59fca6f3 | |
parent | 5b7f5d02b5a432fff116f5e2a17e956e3255cd35 (diff) | |
download | samba-967f2c44b3b911d151ea262b748d68654ba9e2fc.tar.gz samba-967f2c44b3b911d151ea262b748d68654ba9e2fc.tar.bz2 samba-967f2c44b3b911d151ea262b748d68654ba9e2fc.zip |
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
-rw-r--r-- | source3/smbd/smb2_server.c | 7 |
1 files changed, 1 insertions, 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; |