From c4af7ad8dc75ca252c6e8812b126a171849cc7d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 27 Apr 2000 16:53:31 +0000 Subject: Tidyup of smbecho. Jeremy. (This used to be commit 4a4b7a994bbe327216f736133edc51cf9a351716) --- source3/smbd/reply.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 590dc4f427..4134df221e 100644 --- a/source3/smbd/reply.c +++ b/source3/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); -- cgit