summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-09-08 20:47:10 +0100
committerPeter Powell <petpow@saberuk.com>2017-09-09 10:56:41 +0100
commit5fc4403f621ac93ef8a8c250b30436c0fea8f493 (patch)
tree108cb7baaeaed0e07b31da80e3aef404a60bc7fa
parent1bdf114d37a2932138196d3438eddd30bf9d73a2 (diff)
Fix m_cgiirc allowing malformed hosts sent via WEBIRC.
-rw-r--r--src/modules/m_cgiirc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 09f6a4659..9e1a546d6 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -99,7 +99,7 @@ class CommandWebirc : public Command
realhost.set(user, user->host);
realip.set(user, user->GetIPString());
- bool host_ok = (parameters[2].length() < 64);
+ bool host_ok = (parameters[2].length() < 64) && (parameters[2].find_first_not_of("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-") == std::string::npos);
const std::string& newhost = (host_ok ? parameters[2] : parameters[3]);
if (notify)