From 434e2115a15f201908c16c2f290c35098fc42d78 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 4 Mar 2014 14:07:26 +0100 Subject: [PATCH] s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply. Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison (cherry picked from commit b86f90611820bcf7826bd1de3c7b05488a8f1b0e) --- source3/smbd/reply.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 35d42e84bce..0ed5b515904 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3502,10 +3502,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. @@ -3544,6 +3540,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) { -- 2.11.4.GIT