summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-06-02 18:37:16 -0700
committerJeremy Allison <jra@samba.org>2008-06-02 18:37:16 -0700
commit1c0a9759b92c92636f83f965950acc12b07b1eed (patch)
tree7b36f384d1630fc443e4f370b325634e8b8433f1 /source3/libsmb
parent34413e47070e789c1b547647a409fac9929938d4 (diff)
downloadsamba-1c0a9759b92c92636f83f965950acc12b07b1eed.tar.gz
samba-1c0a9759b92c92636f83f965950acc12b07b1eed.tar.bz2
samba-1c0a9759b92c92636f83f965950acc12b07b1eed.zip
Fix bug reported by David Eisner <deisner@gmail.com>. When allocating cli
buffers for large read/write - make sure we take account of the large read/write SMB headers as well as the buffer space. Jeremy. (This used to be commit 19519bca9b64b736d2fe0447b7cd495f00dba60a)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 134c3c8a1d..4285753e20 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1353,9 +1353,9 @@ bool cli_negprot(struct cli_state *cli)
if (cli->capabilities & (CAP_LARGE_READX|CAP_LARGE_WRITEX)) {
SAFE_FREE(cli->outbuf);
SAFE_FREE(cli->inbuf);
- cli->outbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+SAFETY_MARGIN);
- cli->inbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+SAFETY_MARGIN);
- cli->bufsize = CLI_SAMBA_MAX_LARGE_READX_SIZE;
+ cli->outbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+LARGE_WRITEX_HDR_SIZE+SAFETY_MARGIN);
+ cli->inbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+LARGE_WRITEX_HDR_SIZE+SAFETY_MARGIN);
+ cli->bufsize = CLI_SAMBA_MAX_LARGE_READX_SIZE + LARGE_WRITEX_HDR_SIZE;
}
} else if (cli->protocol >= PROTOCOL_LANMAN1) {