r14526: fix the size of the output buffer, we need 1 byte for the Word count
authorStefan Metzmacher <metze@samba.org>
Fri, 17 Mar 2006 17:20:54 +0000 (17:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:57:37 +0000 (13:57 -0500)
now smbsrv_setup_reply() and req_setup_chain_reply() do the same thing

tridge: can you please check if this is correct,
        I wonder why we don't got valgrind errors...
as the over allocation is disabled currently

metze
(This used to be commit 3441a4a74fb324a4dfbca13219df4c55ebcfbf6c)

source4/smb_server/smb/request.c

index 1a3ff23b930e5ceb24babdff46e07d01cf114626..a08a2f6c2020b655cd18955a96988b6817db2f2f 100644 (file)
@@ -105,7 +105,7 @@ void smbsrv_setup_reply(struct smbsrv_request *req, uint_t wct, uint_t buflen)
                return;
        }
 
-       req->out.size = NBT_HDR_SIZE + MIN_SMB_SIZE + wct*2 + buflen;
+       req->out.size = NBT_HDR_SIZE + MIN_SMB_SIZE + 1 + VWV(wct) + 2 + buflen;
 
        /* over allocate by a small amount */
        req->out.allocated = req->out.size + REQ_OVER_ALLOCATION;