From 5fc4403f621ac93ef8a8c250b30436c0fea8f493 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 8 Sep 2017 20:47:10 +0100 Subject: Fix m_cgiirc allowing malformed hosts sent via WEBIRC. --- src/modules/m_cgiirc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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) -- cgit v1.2.3