diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-27 13:07:45 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-27 13:07:45 +0000 |
commit | 4b4efad8a37fcf52e526f3d0aa218b6ab2beb6d9 (patch) | |
tree | 442ccc256865ada3aef2b3537e1853f5a5ee90ea | |
parent | abbe621da60b30a1edf6f145159bd7403feb0e85 (diff) |
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
-rw-r--r-- | src/modules/m_spanningtree.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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, |