mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-11 19:49:02 -04:00
m_ident Reject invalid and error replies
This commit is contained in:
parent
e3e3a35899
commit
ab65f7902f
@ -235,10 +235,16 @@ class IdentRequestSocket : public EventHandler
|
||||
*/
|
||||
ibuf[recvresult] = '\0';
|
||||
std::string buf(ibuf);
|
||||
std::string::size_type lastcolon = buf.rfind(':');
|
||||
if (lastcolon == std::string::npos)
|
||||
|
||||
/* <2 colons: invalid
|
||||
* 2 colons: reply is an error
|
||||
* >3 colons: there is a colon in the ident
|
||||
*/
|
||||
if (std::count(buf.begin(), buf.end(), ':') != 3)
|
||||
return;
|
||||
|
||||
std::string::size_type lastcolon = buf.rfind(':');
|
||||
|
||||
/* Truncate the ident at any characters we don't like, skip leading spaces */
|
||||
for (std::string::const_iterator i = buf.begin()+lastcolon+1; i != buf.end(); ++i)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user