]> jfr.im git - irc/rizon/znc.git/commitdiff
Fix DelClients(), removing clients can modify the client vector
authorAdam <redacted>
Mon, 16 Sep 2013 15:36:26 +0000 (11:36 -0400)
committerAdam <redacted>
Mon, 16 Sep 2013 15:36:26 +0000 (11:36 -0400)
User.cpp

index a906ed91fe38a4cc411ef815894c06d56ed861ba..2ef40b78a64f76f5311e98553c25ba9fd740c3ac 100644 (file)
--- a/User.cpp
+++ b/User.cpp
@@ -364,8 +364,8 @@ bool CUser::UpdateModule(const CString &sModule) {
 }
 
 void CUser::DelClients() {
-       for (unsigned int c = 0; c < m_vClients.size(); c++) {
-               CClient* pClient = m_vClients[c];
+       for (unsigned int c = m_vClients.size(); c > 0; --c) {
+               CClient* pClient = m_vClients[c - 1];
                CZNC::Get().GetManager().DelSockByAddr(pClient);
        }