summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/fakeuser.h2
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp6
-rw-r--r--src/modules/m_spanningtree/utils.cpp2
4 files changed, 7 insertions, 5 deletions
diff --git a/include/fakeuser.h b/include/fakeuser.h
index 3237d4c5b..afb267c52 100644
--- a/include/fakeuser.h
+++ b/include/fakeuser.h
@@ -19,7 +19,7 @@
class CoreExport FakeUser : public User
{
public:
- FakeUser(InspIRCd* Instance) : User(Instance, "!")
+ FakeUser(InspIRCd* Instance, const std::string &uid) : User(Instance, uid)
{
SetFd(FD_FAKEUSER_NUMBER);
}
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index b8eced5f4..3d24c7cd2 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -609,7 +609,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
}
/* set up fake client again this time with the correct uid */
- this->FakeClient = new FakeUser(this);
+ this->FakeClient = new FakeUser(this, "!");
// Get XLine to do it's thing.
this->XLines->CheckELines();
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);
}