diff options
Diffstat (limited to 'src/modules/m_spanningtree/treesocket2.cpp')
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index dedf76786..ff5e7b203 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -815,6 +815,11 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque<std::string> this->SendError("Protocol error - Introduced remote server from unknown server "+prefix); return false; } + if (!Utils->IsSID(sid)) + { + this->SendError("Invalid format server ID: "+sid+"!"); + return false; + } TreeServer* CheckDupe = Utils->FindServer(servername); if (CheckDupe) { @@ -889,6 +894,12 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> ¶ms) return false; } + if (!Utils->IsSID(sid)) + { + this->SendError("Invalid format server ID: "+sid+"!"); + return false; + } + for (std::vector<Link>::iterator x = Utils->LinkBlocks.begin(); x < Utils->LinkBlocks.end(); x++) { if ((x->Name == servername) && ((ComparePass(this->MakePass(x->RecvPass,this->GetOurChallenge()),password)) || (x->RecvPass == password && (this->GetTheirChallenge().empty())))) @@ -960,6 +971,12 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> ¶ms) return false; } + if (!Utils->IsSID(sid)) + { + this->SendError("Invalid format server ID: "+sid+"!"); + return false; + } + for (std::vector<Link>::iterator x = Utils->LinkBlocks.begin(); x < Utils->LinkBlocks.end(); x++) { if ((x->Name == servername) && ((ComparePass(this->MakePass(x->RecvPass,this->GetOurChallenge()),password) || x->RecvPass == password && (this->GetTheirChallenge().empty())))) |