From 9f69e159adcc0892f0bdef16ac4617630737b156 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 16 Apr 2015 23:00:56 +0200 Subject: m_dccallow Validate tokens before use --- src/modules/m_dccallow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/modules/m_dccallow.cpp') diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index b42d12968..829c1d337 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -339,6 +339,9 @@ class ModuleDCCAllow : public Module while (ss >> buf) tokens.push_back(buf); + if (tokens.size() < 2) + return MOD_RES_PASSTHRU; + irc::string type = tokens[1].c_str(); ConfigTag* conftag = ServerInstance->Config->ConfValue("dccallow"); @@ -346,6 +349,9 @@ class ModuleDCCAllow : public Module if (type == "SEND") { + if (tokens.size() < 3) + return MOD_RES_PASSTHRU; + std::string defaultaction = conftag->getString("action"); std::string filename = tokens[2]; -- cgit v1.2.3