diff options
| author | 2009-12-31 20:40:18 +0000 | |
|---|---|---|
| committer | 2009-12-31 20:40:18 +0000 | |
| commit | d7ad4ffdc8de4f118553818937f39e472593c6f8 (patch) | |
| tree | 7cb4cf89c84afac3971e283c914071b764892541 | |
| parent | Correct 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
| -rw-r--r-- | src/modules/m_spanningtree/svsjoin.cpp | 19 |
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> ¶ms) { + // 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; } |
