From 593ec34ff70809189fbcb885be582ad334df0cb9 Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Tue, 28 Jul 2015 18:44:22 -0400 Subject: [PATCH] os_akill: Sanity check AKILLing before modifing the akill list --- modules/commands/os_akill.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index fc2558f2c..81c440ef3 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -156,9 +156,7 @@ class CommandOSAKill : public Command if (Config->GetModule("operserv")->Get("addakiller", "yes") && !source.GetNick().empty()) reason = "[" + source.GetNick() + "] " + reason; - if (!akills->CanAdd(source, mask, expires, reason)) - return; - else if (mask.find_first_not_of("/~@.*?") == Anope::string::npos) + if (mask.find_first_not_of("/~@.*?") == Anope::string::npos) { source.Reply(USERHOST_MASK_TOO_WIDE, mask.c_str()); return; @@ -187,6 +185,9 @@ class CommandOSAKill : public Command return; } + if (!akills->CanAdd(source, mask, expires, reason)) + return; + EventReturn MOD_RESULT; FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, akills)); if (MOD_RESULT == EVENT_STOP)