summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/commands/os_akill.cpp5
-rw-r--r--src/xline.cpp7
2 files changed, 11 insertions, 1 deletions
diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp
index c81a6b515..af8573752 100644
--- a/modules/commands/os_akill.cpp
+++ b/modules/commands/os_akill.cpp
@@ -160,6 +160,11 @@ class CommandOSAKill : public Command
source.Reply(USERHOST_MASK_TOO_WIDE, mask.c_str());
return;
}
+ else if (mask.find('@') == Anope::string::npos)
+ {
+ source.Reply(BAD_USERHOST_MASK);
+ return;
+ }
if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty())
reason = "[" + source.GetNick() + "] " + reason;
diff --git a/src/xline.cpp b/src/xline.cpp
index ea74ba8c7..6b3ba90f4 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -103,7 +103,12 @@ Anope::string XLine::GetHost() const
return this->mask.substr(host_t + 1);
}
else
- return "";
+ {
+ if (real_t != Anope::string::npos)
+ return this->mask.substr(0, real_t);
+ else
+ return this->mask;
+ }
}
Anope::string XLine::GetReal() const