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)
committerKarolin Seeger <kseeger@samba.org>
Tue, 1 Apr 2014 07:08:06 +0000 (09:08 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b86f90611820bcf7826bd1de3c7b05488a8f1b0e)

source3/smbd/reply.c

index e07b40bbe366e952e1f79e9b6f518bdea85d9c99..04f1b7f812b7ca779521ba2061cd424d1aa9b089 100644 (file)
@@ -3501,10 +3501,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. 
@@ -3543,6 +3539,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) {