mirror of
https://github.com/znc/znc.git
synced 2026-08-06 08:52:57 +02:00
Fix a crash with NAMESX
If we were joining a channel on a server with NAMESX support while a client was connected that didn't know NAMESX and we received a raw 353 with a trailing whitespace (UnrealIRCd does this), we were calling std::string::at(0) for an empty string, which caused some assert to fail and ZNC to die. This patch fixes this crash bug. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1118 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+7
-4
@@ -352,10 +352,13 @@ void CIRCSock::ReadLine(const CString& sData) {
|
||||
m_pUser->PutUser(sLine, vClients[a]);
|
||||
} else {
|
||||
unsigned int i = 0;
|
||||
// This loop runs once more than there are nicks,
|
||||
// the last run sets sNick to "" and causes the break.
|
||||
do {
|
||||
sNick = sNicks.Token(i);
|
||||
// This loop runs once for
|
||||
// every nick on the channel
|
||||
for (;;) {
|
||||
sNick = sNicks.Token(i).Trim_n(" ");
|
||||
if (sNick.empty())
|
||||
break;
|
||||
|
||||
if (m_bNamesx && !vClients[a]->HasNamesx()
|
||||
&& IsPermChar(sNick[0])) {
|
||||
// Server has, client hasnt NAMESX,
|
||||
|
||||
Reference in New Issue
Block a user