summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-17 00:47:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:22 -0500
commit1c71db99aa78f489a66d58e1116884c23b0c10f8 (patch)
tree22d017a6ef01bbff41a17a04d1b78657f3db292d /source4/libcli
parent7bfe1d29dd0d8bbe008cc5a91a072da004f25dae (diff)
downloadsamba-1c71db99aa78f489a66d58e1116884c23b0c10f8.tar.gz
samba-1c71db99aa78f489a66d58e1116884c23b0c10f8.tar.bz2
samba-1c71db99aa78f489a66d58e1116884c23b0c10f8.zip
r11751: fixed the req->out.size calculation (it needs to be the complete
request size, including dynamic portion) (This used to be commit 1b5cdf92cc7793b08d7c46ef00d4ff696b31c15e)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/smb2/request.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index bc278897a5..3e80115e47 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -50,14 +50,16 @@ struct smb2_request *smb2_request_init(struct smb2_transport *transport, uint16_
ZERO_STRUCT(req->in);
- req->out.allocated = SMB2_HDR_BODY+NBT_HDR_SIZE+body_fixed_size+body_dynamic_size;
+ req->out.size = SMB2_HDR_BODY+NBT_HDR_SIZE+
+ body_fixed_size+body_dynamic_size;
+
+ req->out.allocated = req->out.size;
req->out.buffer = talloc_size(req, req->out.allocated);
if (req->out.buffer == NULL) {
talloc_free(req);
return NULL;
}
- req->out.size = SMB2_HDR_BODY+NBT_HDR_SIZE+body_fixed_size+(body_dynamic_size?1:0);
req->out.hdr = req->out.buffer + NBT_HDR_SIZE;
req->out.body = req->out.hdr + SMB2_HDR_BODY;
req->out.body_size = body_fixed_size;