summaryrefslogtreecommitdiff
path: root/src/modules/m_dccallow.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-04-16 23:00:56 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-04-16 23:00:56 +0200
commit9f69e159adcc0892f0bdef16ac4617630737b156 (patch)
tree861fe4a5bad38148bb2e84480271f22358535545 /src/modules/m_dccallow.cpp
parent64faca29b377185c4615c8f2e4eecedc7ad045d1 (diff)
m_dccallow Validate tokens before use
Diffstat (limited to 'src/modules/m_dccallow.cpp')
-rw-r--r--src/modules/m_dccallow.cpp6
1 files changed, 6 insertions, 0 deletions
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];