diff options
-rw-r--r-- | source3/libsmb/clireadwrite.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index c714d3b273..a6f79fb1d2 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -732,7 +732,8 @@ NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf, bytes[0] = 1; do { - size_t size = MIN(size1, cli->max_xmit - 48); + uint32_t usable_space = cli_state_available_size(cli, 48); + size_t size = MIN(size1, usable_space); struct tevent_req *req; uint16_t vwv[5]; uint16_t *ret_vwv; |