mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
Fix a std::out_of_range error in partyline
If the CHANTYPES token was the last one in a 005 numeric, partyline would call std::insert() with CString::npos for the position to insert at. This throws a std::out_of_range error. Fix this by using CString::append() in this case. Thanks to Superfly_ for the bug report and helping me reproduce this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2087 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -168,7 +168,10 @@ public:
|
||||
if (uPos != CString::npos) {
|
||||
uPos = sLine.find(" ", uPos);
|
||||
|
||||
sLine.insert(uPos, CHAN_PREFIX_1);
|
||||
if (uPos == CString::npos)
|
||||
sLine.append(CHAN_PREFIX_1);
|
||||
else
|
||||
sLine.insert(uPos, CHAN_PREFIX_1);
|
||||
m_spInjectedPrefixes.insert(m_pUser);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user