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:
psychon
2010-07-16 21:01:50 +00:00
parent 7f53cc810b
commit 1fd22431a0
+4 -1
View File
@@ -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);
}
}