summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-27 16:27:20 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-27 16:27:20 +0000
commit644b87f4a073f3450e1c8299ae9c33f11073de45 (patch)
tree88bef0297902b63da94a4bb1640674e82c4bac8d /src
parent06b12b71ae73cdfceba122e6400dd97830c8cea9 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_timedbans.cpp7
1 files changed, 7 insertions, 0 deletions
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)