From: Jeremy Allison Date: Tue, 3 Jun 2008 01:36:31 +0000 (-0700) Subject: Fix bug reported by David Eisner . When allocating cli X-Git-Tag: samba-3.0.31~18^2~7 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=c537b4376db8eb17904d2cf5fa3ec1fa32548742;p=samba.git Fix bug reported by David Eisner . 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. --- diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index c4671916ec4..b2425e32ec7 100644 --- a/source/libsmb/cliconnect.c +++ b/source/libsmb/cliconnect.c @@ -1330,9 +1330,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) {