summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/svsjoin.cpp
diff options
context:
space:
mode:
authorGravatar w00t2009-12-31 20:40:18 +0000
committerGravatar w00t2009-12-31 20:40:18 +0000
commitd7ad4ffdc8de4f118553818937f39e472593c6f8 (patch)
tree7cb4cf89c84afac3971e283c914071b764892541 /src/modules/m_spanningtree/svsjoin.cpp
parentCorrect fix by Namegduf for bug #922, as my earlier fix just made it worse (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.. git-svn-id: http://svn.inspircd.org/repository/branches/1_2_stable@12234 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/svsjoin.cpp')
-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 38ba687cc..f21a6d23e 100644
--- a/src/modules/m_spanningtree/svsjoin.cpp
+++ b/src/modules/m_spanningtree/svsjoin.cpp
@@ -28,18 +28,23 @@
bool TreeSocket::ServiceJoin(const std::string &prefix, std::deque<std::string> &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 = this->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(this->ServerInstance, 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(this->ServerInstance, u, params[1].c_str(), false, "", false, ServerInstance->Time());
+ Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
return true;
}