summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorDaniel De Graaf <danieldg@inspircd.org>2010-04-16 21:45:09 -0500
committerDaniel De Graaf <danieldg@inspircd.org>2010-04-16 21:47:23 -0500
commit49223cfe12ecd9071123f724e615e63841f2421d (patch)
treea2db88ccbfedb6bc5c8d21b832a03d129aa8913e /src/modules
parent2112152e3369be27ae6ecb1a14205e64b8f85999 (diff)
Fix crash when a remote server has the same name as we do
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/server.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp
index 82777845e..6e3bcafaa 100644
--- a/src/modules/m_spanningtree/server.cpp
+++ b/src/modules/m_spanningtree/server.cpp
@@ -223,8 +223,9 @@ bool TreeSocket::Inbound_Server(parameterlist &params)
TreeServer* CheckDupe = Utils->FindServer(sname);
if (CheckDupe)
{
- this->SendError("Server "+sname+" already exists on server "+CheckDupe->GetParent()->GetName()+"!");
- ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
+ std::string pname = CheckDupe->GetParent() ? CheckDupe->GetParent()->GetName() : "<ourself>";
+ SendError("Server "+sname+" already exists on server "+pname+"!");
+ ServerInstance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, already exists on server "+pname);
return false;
}