From 644b87f4a073f3450e1c8299ae9c33f11073de45 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 27 Apr 2005 16:27:20 +0000 Subject: A little more error checking on the banmask etc git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1218 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_timedbans.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 5649a9e37..f75791b2c 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -48,6 +48,11 @@ void handle_tban(char **parameters, int pcnt, userrec *user) std::string cm = Srv->ChanMode(user,channel); if ((cm == "%") || (cm == "@")) { + if (!Srv->IsValidMask(parameters[2])) + { + Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Invalid ban mask"); + return; + } for (timedbans::iterator i = TimedBanList.begin(); i < TimedBanList.end(); i++) { if ((!strcasecmp(i->mask.c_str(),parameters[2])) && (!strcasecmp(i->channel.c_str(),parameters[0]))) @@ -94,11 +99,13 @@ class ModuleTimedBans : public Module { Srv = new Server; Srv->AddCommand("TBAN",handle_tban,0,3,"m_timedbans.so"); + TimedBanList.clear(); } virtual ~ModuleTimedBans() { delete Srv; + TimedBanList.clear(); } virtual void OnBackgroundTimer(time_t curtime) -- cgit v1.2.3