summaryrefslogtreecommitdiff
path: root/modules/protocol
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-05-13 22:57:53 -0400
committerAdam <Adam@anope.org>2014-05-13 22:57:53 -0400
commit63b02b8c97e73d5a1fc7005e9693a954179ded0d (patch)
tree84d67d16b8f984eef67653c7a50f7154aa33bb23 /modules/protocol
parent1c8a77ab9f4adfd0afd8217bc462bb338925dcea (diff)
Sanitize nuh masks more to prevent the other side from rewriting them, which screws with our internal tracking of them
Diffstat (limited to 'modules/protocol')
-rw-r--r--modules/protocol/bahamut.cpp2
-rw-r--r--modules/protocol/inspircd12.cpp2
-rw-r--r--modules/protocol/inspircd20.cpp13
-rw-r--r--modules/protocol/unreal.cpp2
4 files changed, 10 insertions, 9 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 72c3ee8f9..206bca250 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -16,7 +16,7 @@ class ChannelModeFlood : public ChannelModeParam
public:
ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { }
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
try
{
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index 0cf3e991d..8b17d4140 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -28,7 +28,7 @@ class ChannelModeFlood : public ChannelModeParam
public:
ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { }
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
try
{
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 07c25972c..b27249234 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -239,7 +239,7 @@ class ColonDelimitedParamMode : public ChannelModeParam
public:
ColonDelimitedParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { }
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
return IsValid(value, false);
}
@@ -288,7 +288,7 @@ class SimpleNumberParamMode : public ChannelModeParam
public:
SimpleNumberParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { }
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
if (value.empty())
return false; // empty param is never valid
@@ -313,11 +313,12 @@ class ChannelModeFlood : public ColonDelimitedParamMode
public:
ChannelModeFlood(char modeChar) : ColonDelimitedParamMode("FLOOD", modeChar) { }
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
// The parameter of this mode is a bit different, it may begin with a '*',
// ignore it if that's the case
- return ((!value.empty()) && (ColonDelimitedParamMode::IsValid(value[0] == '*' ? value.substr(1) : value)));
+ Anope::string v = value[0] == '*' ? value.substr(1) : value;
+ return ((!value.empty()) && (ColonDelimitedParamMode::IsValid(v)));
}
};
@@ -326,7 +327,7 @@ class ChannelModeHistory : public ColonDelimitedParamMode
public:
ChannelModeHistory(char modeChar) : ColonDelimitedParamMode("HISTORY", modeChar) { }
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
return (ColonDelimitedParamMode::IsValid(value, true));
}
@@ -337,7 +338,7 @@ class ChannelModeRedirect : public ChannelModeParam
public:
ChannelModeRedirect(char modeChar) : ChannelModeParam("REDIRECT", modeChar, true) { }
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
// The parameter of this mode is a channel, and channel names start with '#'
return ((!value.empty()) && (value[0] == '#'));
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index f444947f6..fd7cb8e81 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -547,7 +547,7 @@ class ChannelModeFlood : public ChannelModeParam
ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { }
/* Borrowed part of this check from UnrealIRCd */
- bool IsValid(const Anope::string &value) const anope_override
+ bool IsValid(Anope::string &value) const anope_override
{
if (value.empty())
return false;