summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp12
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,