mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix an out-of-range access to std::string
When we received a "PING" from a client without an argument, std::string would throw a std::out_of_range exception which killed znc. Thanks to Sm0ke0ut for reporting this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2093 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -180,7 +180,10 @@ void CClient::ReadLine(const CString& sData) {
|
||||
} else if (sCommand.Equals("PING")) {
|
||||
// All PONGs are generated by znc. We will still forward this to
|
||||
// the ircd, but all PONGs from irc will be blocked.
|
||||
PutClient(":irc.znc.in PONG irc.znc.in " + sLine.substr(5));
|
||||
if (sLine.length() >= 5)
|
||||
PutClient(":irc.znc.in PONG irc.znc.in " + sLine.substr(5));
|
||||
else
|
||||
PutClient(":irc.znc.in PONG irc.znc.in");
|
||||
} else if (sCommand.Equals("PONG")) {
|
||||
// Block PONGs, we already responded to the pings
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user