From: Stefan Metzmacher Date: Tue, 8 Jan 2019 15:11:15 +0000 (+0100) Subject: s4:libcli/smb2: calculate the correct credit charge in smb2_getinfo_send() X-Git-Tag: tdb-1.4.1~594 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c88c2bf3b54a0faf8a77daf9b8827c101db9be95;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison --- 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;