mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-11 19:49:02 -04:00
m_channames Fix iteration in ValidateChans()
Spotted by @Adam-
This commit is contained in:
parent
740539d620
commit
ecf7690813
@ -89,9 +89,17 @@ class ModuleChannelNames : public Module
|
||||
ServerInstance->SendGlobalMode(modes, ServerInstance->FakeClient);
|
||||
}
|
||||
const UserMembList* users = c->GetUsers();
|
||||
for(UserMembCIter j = users->begin(); j != users->end(); ++j)
|
||||
for(UserMembCIter j = users->begin(); j != users->end(); )
|
||||
{
|
||||
if (IS_LOCAL(j->first))
|
||||
c->KickUser(ServerInstance->FakeClient, j->first, "Channel name no longer valid");
|
||||
{
|
||||
// KickUser invalidates the iterator
|
||||
UserMembCIter it = j++;
|
||||
c->KickUser(ServerInstance->FakeClient, it->first, "Channel name no longer valid");
|
||||
}
|
||||
else
|
||||
++j;
|
||||
}
|
||||
}
|
||||
badchan = false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user