[PATCH] smbd: Fix bug 10839
Stefan (metze) Metzmacher
metze at samba.org
Mon Mar 2 01:50:12 MST 2015
Hi Volker,
> - status = smbd_smb2_request_verify_creditcharge(req,
> - MAX(in_input_buffer.length,in_output_buffer_length));
> + credit_charge = MAX(in_input_buffer.length, in_output_buffer_length);
> + if (xconn->smb2.credits.ignore_broken_multicredit) {
> + /*
> + * see comment in globals.h where ignore_broken_multicredit
> + * is defined
> + */
> + credit_charge = 65536;
> + }
> +
> + status = smbd_smb2_request_verify_creditcharge(req, credit_charge);
> if (!NT_STATUS_IS_OK(status)) {
> return smbd_smb2_request_error(req, status);
> }
What about just using something like this:
if (!xconn->smb2.credits.ignore_broken_multicredit) {
status = smbd_smb2_request_verify_creditcharge(req,
MAX(in_input_buffer.length,in_output_buffer_length));
if (!NT_STATUS_IS_OK(status)) {
return smbd_smb2_request_error(req, status);
}
}
There's no reason to call smbd_smb2_request_verify_creditcharge()
at all if pass a fixed value to it. This avoids the confusing name
'credit_charge'
for the altered argument.
metze
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150302/ff5fd487/attachment.pgp>
More information about the samba-technical
mailing list