1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-24 21:49:29 +03:00

Fix buggy data_len calculation in echo. Add paranoia debug message.

Jeremy.
(This used to be commit 5332af1124)
This commit is contained in:
Jeremy Allison
2003-10-16 18:17:44 +00:00
parent 53efe50458
commit 3a9510acae

View File

@ -2784,7 +2784,11 @@ int reply_echo(connection_struct *conn,
int outsize = set_message(outbuf,1,data_len,True);
START_PROFILE(SMBecho);
data_len = MIN(data_len, (sizeof(inbuf)-(smb_buf(inbuf)-inbuf)));
if (data_len > BUFFER_SIZE) {
DEBUG(0,("reply_echo: data_len too large.\n"));
END_PROFILE(SMBecho);
return -1;
}
/* copy any incoming data back out */
if (data_len > 0)