From 02c6ce1ad09a7471a6b03dc00bac4b843d157489 Mon Sep 17 00:00:00 2001 From: peavey Date: Fri, 15 Jun 2007 10:05:39 +0000 Subject: Fix crash on propogation after routed squit has reached it's destination. Thx HiroP. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7330 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/rsquit.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index cfe2a8c90..86ba4d306 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -66,17 +66,20 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user) NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[1])+" matches local server name)"); return CMD_FAILURE; } - TreeSocket* sock = s->GetSocket(); - if (!sock) + if (s) { - NoticeUser(user, "*** RSQUIT: Server \002"+ConvToStr(parameters[1])+"\002 isn't connected to \002"+ConvToStr(parameters[0])+"\002."); - return CMD_FAILURE; + TreeSocket* sock = s->GetSocket(); + if (!sock) + { + NoticeUser(user, "*** RSQUIT: Server \002"+ConvToStr(parameters[1])+"\002 isn't connected to \002"+ConvToStr(parameters[0])+"\002."); + return CMD_FAILURE; + } + ServerInstance->SNO->WriteToSnoMask('l',"Remote SQUIT from %s matching \002%s\002, squitting server \002%s\002",user->nick,parameters[0],parameters[1]); + const char* para[1]; + para[0] = parameters[1]; + std::string original_command = std::string("SQUIT ") + parameters[1]; + Creator->OnPreCommand("SQUIT", para, 1, user, true, original_command); } - ServerInstance->SNO->WriteToSnoMask('l',"Remote SQUIT from %s matching \002%s\002, squitting server \002%s\002",user->nick,parameters[0],parameters[1]); - const char* para[1]; - para[0] = parameters[1]; - std::string original_command = std::string("SQUIT ") + parameters[1]; - Creator->OnPreCommand("SQUIT", para, 1, user, true, original_command); } } else -- cgit v1.2.3