s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.
authorStefan Metzmacher <metze@samba.org>
Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 5 Mar 2014 18:06:24 +0000 (10:06 -0800)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/reply.c

index 112c9e6b498acd98c8b125bac7ccaae646c08a86..eacb0fb0315babd6e76f60278a667859db59f710 100644 (file)
@@ -3492,10 +3492,6 @@ void reply_lockread(struct smb_request *req)
 
        numtoread = MIN(BUFFER_SIZE - (smb_size + 5*2 + 3), numtoread);
 
-       reply_outbuf(req, 5, numtoread + 3);
-
-       data = smb_buf(req->outbuf) + 3;
-
        /*
         * NB. Discovered by Menny Hamburger at Mainsoft. This is a core+
         * protocol request that predates the read/write lock concept. 
@@ -3534,6 +3530,11 @@ Returning short read of maximum allowed for compatibility with Windows 2000.\n",
                        (unsigned int)sconn->smb1.negprot.max_recv));
                numtoread = MIN(numtoread, sconn->smb1.negprot.max_recv);
        }
+
+       reply_outbuf(req, 5, numtoread + 3);
+
+       data = smb_buf(req->outbuf) + 3;
+
        nread = read_file(fsp,data,startpos,numtoread);
 
        if (nread < 0) {