summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-18 10:19:12 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-18 10:19:12 +0000
commit3d0dc0e357b3da442ff7391705bfc4b4d6c205b6 (patch)
tree9c9402ec09794b7c79197b2656d74948ddfbdf0d /src/modules
parent56cec38f3e7d3447b40076481c15e6d4a7e278d0 (diff)
Don't allow adding of invalid nicknames to watchlist
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4945 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_watch.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp
index d01bc045a..450d9470c 100644
--- a/src/modules/m_watch.cpp
+++ b/src/modules/m_watch.cpp
@@ -130,6 +130,11 @@ class cmd_watch : public command_t
{
// removing an item from the list
nick++;
+ if (!ServerInstance->IsNick(nick))
+ {
+ user->WriteServ("942 %s %s :Invalid nickname",user->nick,nick);
+ return;
+ }
irc::string n1 = nick;
for (watchlist::iterator q = watches.begin(); q != watches.end(); q++)
{
@@ -144,7 +149,7 @@ class cmd_watch : public command_t
}
else
{
- user->WriteServ("602 %s %s * * 0 :stopped watching",user->nick,b->target.c_str());
+ user->WriteServ("602 %s %s * * 0 :stopped watching",user->nick,b->target.c_str());
}
if (n1 == n2)
{
@@ -158,6 +163,11 @@ class cmd_watch : public command_t
else if (nick[0] == '+')
{
nick++;
+ if (!ServerInstance->IsNick(nick))
+ {
+ user->WriteServ("942 %s %s :Invalid nickname",user->nick,nick);
+ return;
+ }
irc::string n1 = nick;
bool exists = false;
for (watchlist::iterator q = watches.begin(); q != watches.end(); q++)