From: Attila Molnar Date: Thu, 16 Apr 2015 21:00:56 +0000 (+0200) Subject: m_dccallow Validate tokens before use X-Git-Tag: v2.0.23~62 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=9f69e159adcc0892f0bdef16ac4617630737b156;hp=64faca29b377185c4615c8f2e4eecedc7ad045d1;p=user%2Fhenk%2Fcode%2Finspircd.git m_dccallow Validate tokens before use --- 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];