]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_dccallow Validate tokens before use
authorAttila Molnar <attilamolnar@hush.com>
Thu, 16 Apr 2015 21:00:56 +0000 (23:00 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Thu, 16 Apr 2015 21:00:56 +0000 (23:00 +0200)
src/modules/m_dccallow.cpp

index b42d129688c18d121b4dc1fe2434bdec761387e0..829c1d3378ce91a3229f4de51ef15a6fc7a47611 100644 (file)
@@ -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];