diff options
| author | 2010-02-15 03:02:39 +0000 | |
|---|---|---|
| committer | 2010-02-15 03:02:39 +0000 | |
| commit | ace6e82aa9ad64fb77c01272c553667360ffda4e (patch) | |
| tree | 5e238cd92761c40e33fda02fe8418923e7a4d921 /src/modules/m_spanningtree/treesocket2.cpp | |
| parent | Call OnClose() before changing link state to DYING to clean up introduced ser... (diff) | |
Fix race where two servers with the same name can enter WAIT_AUTH_2 and cause a double-free crash
git-svn-id: http://svn.inspircd.org/repository/branches/1_2_stable@12461 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/treesocket2.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 713f5d108..4e7d4da47 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -96,8 +96,6 @@ bool TreeSocket::ProcessLine(std::string &line) switch (this->LinkState) { - TreeServer* Node; - case DYING: return false; case WAIT_AUTH_1: @@ -179,12 +177,8 @@ bool TreeSocket::ProcessLine(std::string &line) this->LinkState = CONNECTED; Utils->timeoutlist.erase(this); + TreeServer *Node = Utils->FindServer(InboundServerName); - Link* lnk = Utils->FindLink(InboundServerName); - - Node = new TreeServer(this->Utils, this->ServerInstance, InboundServerName, InboundDescription, InboundSID, Utils->TreeRoot, this, lnk ? lnk->Hidden : false); - - Utils->TreeRoot->AddChild(Node); parameterlist sparams; sparams.push_back(InboundServerName); sparams.push_back("*"); @@ -193,7 +187,6 @@ bool TreeSocket::ProcessLine(std::string &line) sparams.push_back(":"+InboundDescription); Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",sparams,InboundServerName); Utils->DoOneToAllButSenderRaw(line, InboundServerName, prefix, command, params); - Node->bursting = true; this->DoBurst(Node); } else if (command == "ERROR") @@ -619,7 +612,7 @@ void TreeSocket::OnTimeout() void TreeSocket::OnClose() { // Test fix for big fuckup - if (this->LinkState != CONNECTED) + if (this->LinkState != CONNECTED && this->LinkState != WAIT_AUTH_2) return; // Connection closed. |
