summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-11-09 03:20:46 +0100
committerattilamolnar <attilamolnar@hush.com>2012-11-09 17:23:10 +0100
commit2cbbc1ce84f5c4c3733c1c64d4f7f491f7aabbcd (patch)
tree11e650fe11c5323100e3711a6ed8a89bc9b0aa33 /src/modules/m_spanningtree
parent755ff533e511997843afe8f609c8c936481b55be (diff)
m_spanningtree Refuse bogus NICK messages
If the new nick looks like an uid verify that its the correct uid
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 67908c414..e93dece5f 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -394,7 +394,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
{
if (params.size() != 2)
{
- SendError("Protocol violation: NICK message without TS - :"+who->uuid+" NICK "+params[0]);
+ SendError("Protocol violation: Wrong number of parameters for NICK message");
return;
}
@@ -404,6 +404,12 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
return;
}
+ if ((isdigit(params[0][0])) && (params[0] != who->uuid))
+ {
+ SendError("Protocol violation: User changing nick to an invalid UID - " + params[0]);
+ return;
+ }
+
/* Update timestamp on user when they change nicks */
who->age = atoi(params[1].c_str());