summaryrefslogtreecommitdiff
path: root/source4/libcli/smb2
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-01-08 16:11:15 +0100
committerJeremy Allison <jra@samba.org>2019-03-28 23:09:36 +0000
commitc88c2bf3b54a0faf8a77daf9b8827c101db9be95 (patch)
treefd59ecb794736c815f4a82517c30be0c3658de19 /source4/libcli/smb2
parentee2574ae5675ef0ea9b14c13677acf6c003497e0 (diff)
downloadsamba-c88c2bf3b54a0faf8a77daf9b8827c101db9be95.tar.gz
s4:libcli/smb2: calculate the correct credit charge in smb2_getinfo_send()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13863 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/libcli/smb2')
-rw-r--r--source4/libcli/smb2/getinfo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/libcli/smb2/getinfo.c b/source4/libcli/smb2/getinfo.c
index 591309c62f7..7a8fd44a855 100644
--- a/source4/libcli/smb2/getinfo.c
+++ b/source4/libcli/smb2/getinfo.c
@@ -32,6 +32,7 @@ struct smb2_request *smb2_getinfo_send(struct smb2_tree *tree, struct smb2_getin
{
struct smb2_request *req;
NTSTATUS status;
+ size_t max_payload;
req = smb2_request_init_tree(tree, SMB2_OP_GETINFO, 0x28, true,
io->in.input_buffer.length);
@@ -63,6 +64,9 @@ struct smb2_request *smb2_getinfo_send(struct smb2_tree *tree, struct smb2_getin
}
SSVAL(req->out.body, 0x0C, io->in.reserved);
+ max_payload = MAX(io->in.output_buffer_length, io->in.input_buffer.length);
+ req->credit_charge = (MAX(max_payload, 1) - 1)/ 65536 + 1;
+
smb2_transport_send(req);
return req;