summaryrefslogtreecommitdiffstats
path: root/source/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-04-27 16:53:31 +0000
committerJeremy Allison <jra@samba.org>2000-04-27 16:53:31 +0000
commit4a4b7a994bbe327216f736133edc51cf9a351716 (patch)
treeee670dcd61f680564310dcc9f751af1150dfcdec /source/smbd/reply.c
parentb040be5ef967a9149cd6a4955b8e0404152e9f15 (diff)
downloadsamba-4a4b7a994bbe327216f736133edc51cf9a351716.tar.gz
samba-4a4b7a994bbe327216f736133edc51cf9a351716.tar.xz
samba-4a4b7a994bbe327216f736133edc51cf9a351716.zip
Tidyup of smbecho.
Jeremy.
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r--source/smbd/reply.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 590dc4f4270..4134df221e7 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -2960,9 +2960,11 @@ int reply_echo(connection_struct *conn,
{
int smb_reverb = SVAL(inbuf,smb_vwv0);
int seq_num;
- int data_len = smb_buflen(inbuf);
+ unsigned int data_len = smb_buflen(inbuf);
int outsize = set_message(outbuf,1,data_len,True);
-
+
+ data_len = MIN(data_len, (sizeof(inbuf)-(smb_buf(inbuf)-inbuf)));
+
/* copy any incoming data back out */
if (data_len > 0)
memcpy(smb_buf(outbuf),smb_buf(inbuf),data_len);