X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_gecosban.cpp;h=1497c1b87b3f808503c80da9a03df7d22fb14669;hb=4c751dbbe8945e5efc230a59b0ed51c2ba10cf92;hp=e7eca6d8fd20a7ac4a8f6561ef4fda7e8c7992e0;hpb=553a8da754c8cd308bad2008018849714e70f9b7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp index e7eca6d8f..1497c1b87 100644 --- a/src/modules/m_gecosban.cpp +++ b/src/modules/m_gecosban.cpp @@ -24,10 +24,10 @@ class ModuleGecosBan : public Module { public: - ModuleGecosBan() + void init() { Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } ~ModuleGecosBan() @@ -41,7 +41,7 @@ class ModuleGecosBan : public Module ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) { - if (mask[0] == 'r' && mask[1] == ':') + if ((mask.length() > 2) && (mask[0] == 'r') && (mask[1] == ':')) { if (InspIRCd::Match(user->fullname, mask.substr(2))) return MOD_RES_DENY;