From f6aea98dc5c3d9e2e54cde5aaf3198eee3c1ebfb Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 23 Apr 2013 15:10:33 +0200 Subject: m_spanningtree Fix crash when connecting to a remote server that has the same name as we do and also there is a link block with our server name and their password See 49223cfe12ecd9071123f724e615e63841f2421d --- src/modules/m_spanningtree/server.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index a04454f51..05441da0c 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -137,8 +137,9 @@ bool TreeSocket::Outbound_Reply_Server(parameterlist ¶ms) 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() : ""; + 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; } CheckDupe = Utils->FindServer(sid); -- cgit v1.2.3