From 3bbb36695383badf5b3ba0ecba070f16094ae51d Mon Sep 17 00:00:00 2001 From: special Date: Fri, 18 May 2007 20:54:49 +0000 Subject: Fixed a fairly low-risk crash in m_spanningtree git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7042 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket2.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index d8b495b49..afba5b96a 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -970,7 +970,10 @@ void TreeSocket::Split(const std::string &line, std::deque &n) irc::tokenstream tokens(line); std::string param; while (tokens.GetToken(param)) - n.push_back(param); + { + if (!param.empty()) + n.push_back(param); + } return; } @@ -988,7 +991,10 @@ bool TreeSocket::ProcessLine(std::string &line) Instance->Log(DEBUG, "S[%d] <- %s", this->GetFd(), line.c_str()); this->Split(line.c_str(),params); - + + if (params.empty()) + return true; + if ((params[0][0] == ':') && (params.size() > 1)) { prefix = params[0].substr(1); -- cgit v1.2.3