X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_channames.cpp;h=325e8fee11735c46f24f6790d82a9f7a8f233f21;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=e78171c4af53816bfc1d7c1b6a5865ac4055e89d;hpb=84a1569cd60daa64b1ae52a1fff62c0dc4d78850;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp index e78171c4a..325e8fee1 100644 --- a/src/modules/m_channames.cpp +++ b/src/modules/m_channames.cpp @@ -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; } @@ -101,6 +109,12 @@ class ModuleChannelNames : public Module ConfigTag* tag = ServerInstance->Config->ConfValue("channames"); std::string denyToken = tag->getString("denyrange"); std::string allowToken = tag->getString("allowrange"); + + if (!denyToken.compare(0, 2, "0-")) + denyToken[0] = '1'; + if (!allowToken.compare(0, 2, "0-")) + allowToken[0] = '1'; + allowedmap.set(); irc::portparser denyrange(denyToken, false);