X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_channelban.cpp;h=6eec486ea8a1a4cab6149d6e4651f5f3115b3859;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=655ed82cd9e1c5a842685de0e1bf5f2e274e7024;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_channelban.cpp b/src/modules/m_channelban.cpp index 655ed82cd..6eec486ea 100644 --- a/src/modules/m_channelban.cpp +++ b/src/modules/m_channelban.cpp @@ -26,9 +26,10 @@ class ModuleBadChannelExtban : public Module { private: public: - ModuleBadChannelExtban() { + void init() + { Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } ~ModuleBadChannelExtban() @@ -42,7 +43,7 @@ class ModuleBadChannelExtban : public Module ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) { - if (mask[0] == 'j' && mask[1] == ':') + if ((mask.length() > 2) && (mask[0] == 'j') && (mask[1] == ':')) { std::string rm = mask.substr(2); char status = 0;