summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-12 05:09:38 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-12 05:09:38 +0000
commitd131485ce97baf0a33a68ad2febdd769f38200b6 (patch)
treee34c8d0d69c1b74ea5895e0aa9d69ae4ea5ab299 /src/modules
parentf1a009a25242007fa9cff853b14cc72a3356ae08 (diff)
Fix an oper-triggerable crash on CBAN; found by Taros
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11211 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_cban.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index e9cf1ce0a..32a2e99a2 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -111,10 +111,11 @@ class CommandCBan : public Command
// Adding - XXX todo make this respect <insane> tag perhaps..
long duration = ServerInstance->Duration(parameters[1]);
CBan *r = NULL;
+ const char *reason = (parameters.size() > 2) ? parameters[2].c_str() : "No reason supplied";
try
{
- r = new CBan(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
+ r = new CBan(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), reason, parameters[0].c_str());
}
catch (...)
{
@@ -127,12 +128,12 @@ class CommandCBan : public Command
{
if (!duration)
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent CBan for %s: %s", user->nick.c_str(), parameters[0].c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent CBan for %s: %s", user->nick.c_str(), parameters[0].c_str(), reason);
}
else
{
time_t c_requires_crap = duration + ServerInstance->Time();
- ServerInstance->SNO->WriteToSnoMask('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str(), parameters[2].c_str());
+ ServerInstance->SNO->WriteToSnoMask('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str(), reason);
}
ServerInstance->XLines->ApplyLines();