summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-14 01:11:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:37 -0500
commit63cfa904ad186bb9d793584d319bd4a7107cc8b9 (patch)
tree15a0fae417c1c70da58edbe4f96a06db1c3f1cb1 /source/smbd
parent9d4e57f06c4f75f42036e91401b0d0392647752b (diff)
downloadsamba-63cfa904ad186bb9d793584d319bd4a7107cc8b9.tar.gz
samba-63cfa904ad186bb9d793584d319bd4a7107cc8b9.tar.xz
samba-63cfa904ad186bb9d793584d319bd4a7107cc8b9.zip
r4190: When changing length calculations, get them right......
Jeremy.
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/process.c2
-rw-r--r--source/smbd/reply.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/source/smbd/process.c b/source/smbd/process.c
index aa1f574767b..1372ebbf458 100644
--- a/source/smbd/process.c
+++ b/source/smbd/process.c
@@ -1177,7 +1177,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
int outsize2;
char inbuf_saved[smb_wct];
char outbuf_saved[smb_wct];
- int outsize = smb_len(outbuf);
+ int outsize = smb_len(outbuf) + 4;
/* maybe its not chained */
if (smb_com2 == 0xFF) {
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 3dae67efefe..eead0bc1a14 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -2112,6 +2112,7 @@ Returning short read of maximum allowed for compatibility with Windows 2000.\n",
int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length, int len_outbuf,
files_struct *fsp, SMB_OFF_T startpos, size_t smb_maxcnt)
{
+ int outsize = 0;
ssize_t nread = -1;
char *data = smb_buf(outbuf);
@@ -2197,7 +2198,7 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length
return(UNIXERROR(ERRDOS,ERRnoaccess));
}
- set_message(outbuf,12,nread,False);
+ outsize = set_message(outbuf,12,nread,False);
SSVAL(outbuf,smb_vwv2,0xFFFF); /* Remaining - must be -1. */
SSVAL(outbuf,smb_vwv5,nread);
SSVAL(outbuf,smb_vwv6,smb_offset(data,outbuf));
@@ -2207,7 +2208,7 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length
DEBUG( 3, ( "send_file_readX fnum=%d max=%d nread=%d\n",
fsp->fnum, (int)smb_maxcnt, (int)nread ) );
- return nread;
+ return outsize;
}
/****************************************************************************