summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-12-31 20:49:35 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-12-31 20:49:35 +0000
commite4907b2ac7c9c17868128a868a033efbbc0625ea (patch)
tree7509e728c6eade4964f16a69b98afb910f06fe25
parent00a4af195f6218e9970adba8cf4e3c42d7a46663 (diff)
Check channel name in SVSJOIN to avoid propegating an invalid channel, fixes bug #928.
This will result in a mild desync if someone has (ab)used SVSJOIN when linking a server running this to their network, but since those channels are screwed anyway.. Conflicts: src/modules/m_spanningtree/svsjoin.cpp git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12235 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_spanningtree/svsjoin.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp
index 4fdc05dea..d8df6fb95 100644
--- a/src/modules/m_spanningtree/svsjoin.cpp
+++ b/src/modules/m_spanningtree/svsjoin.cpp
@@ -25,18 +25,23 @@
bool TreeSocket::ServiceJoin(const std::string &prefix, parameterlist &params)
{
+ // Check params
if (params.size() < 2)
return true;
+ // Check for valid channel name
+ if (!ServerInstance->IsChannel(params[1].c_str(), ServerInstance->Config->Limits.ChanMax))
+ return true;
+
+ // Check target exists
User* u = ServerInstance->FindNick(params[0]);
+ if (!u)
+ return true;
- if (u)
- {
- /* only join if it's local, otherwise just pass it on! */
- if (IS_LOCAL(u))
- Channel::JoinUser(u, params[1].c_str(), false, "", false, ServerInstance->Time());
- Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
- }
+ /* only join if it's local, otherwise just pass it on! */
+ if (IS_LOCAL(u))
+ Channel::JoinUser(u, params[1].c_str(), false, "", false, ServerInstance->Time());
+ Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
return true;
}