From 4b4efad8a37fcf52e526f3d0aa218b6ab2beb6d9 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 27 Aug 2006 13:07:45 +0000 Subject: Bail out if we get a non-existent user git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5033 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index a61791c43..95a6a97f2 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1388,7 +1388,7 @@ class TreeSocket : public InspSocket while (item != "") { item = users.GetToken(); - /* process one channel at a time, applying modes. */ + /* process one user at a time, applying modes. */ char* usr = (char*)item.c_str(); /* Safety check just to make sure someones not sent us an FJOIN full of spaces * (is this even possible?) */ @@ -1407,7 +1407,7 @@ class TreeSocket : public InspSocket else { this->Instance->WriteOpers("ERROR: We received a user with an unknown prefix '%c'. Closed connection to avoid a desync.",mh->GetPrefix()); - this->WriteLine(std::string("ERROR :What?! You sent me a mode prefix i cant handle ('")+mh->GetModeChar()+"'). Closing connection to avoid desync."); + this->WriteLine(std::string("ERROR :Invalid prefix '")+mh->GetModeChar()+"' in FJOIN"); return false; } usr++; @@ -1465,6 +1465,14 @@ class TreeSocket : public InspSocket modectr = 2; } } + else + { + for (unsigned int f = 2; f < modectr; f++) + free(mode_users[f]); + + this->WriteLine("ERROR :Invalid user '"+std::string(usr)+"' in FJOIN to '"+channel+"'"); + return false; + } } } /* there werent enough modes built up to flush it during FJOIN, -- cgit v1.2.3