Author: tridge
Date: 2005-11-17 00:47:50 +0000 (Thu, 17 Nov 2005)
New Revision: 11751

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11751

Log:

fixed the req->out.size calculation (it needs to be the complete
request size, including dynamic portion)


Modified:
   branches/SAMBA_4_0/source/libcli/smb2/request.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/smb2/request.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/smb2/request.c     2005-11-16 20:53:54 UTC 
(rev 11750)
+++ branches/SAMBA_4_0/source/libcli/smb2/request.c     2005-11-17 00:47:50 UTC 
(rev 11751)
@@ -50,14 +50,16 @@
 
        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;

Reply via email to