diff options
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); |