diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 9f99a7416..68b5a7840 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -299,8 +299,10 @@ bool TreeSocket::ProcessLine(std::string &line) TreeServer *ServerSource = Utils->FindServer(prefix); if (ServerSource) { - Utils->ServerUser->server = ServerSource->GetName().c_str(); - Utils->ServerUser->uid = ServerSource->GetID(); + // ServerSource->GetName().c_str() may become invalid before it is used + Utils->ServerUser->nick = ServerSource->GetName().c_str(); + Utils->ServerUser->server = Utils->ServerUser->nick.c_str(); + Utils->ServerUser->uuid = ServerSource->GetID(); } /* Find the link we just got this from so we don't bounce it back incorrectly */ diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 23dd6084e..4ea5513ed 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -154,7 +154,7 @@ SpanningTreeUtilities::SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningT ServerInstance->Logs->Log("m_spanningtree",DEBUG,"***** Using SID for hash: %s *****", ServerInstance->Config->GetSID().c_str()); this->TreeRoot = new TreeServer(this, ServerInstance, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, ServerInstance->Config->GetSID()); - this->ServerUser = new FakeUser(ServerInstance); + this->ServerUser = new FakeUser(ServerInstance, TreeRoot->GetID()); this->ReadConfiguration(true); } |