From 3d0dc0e357b3da442ff7391705bfc4b4d6c205b6 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 18 Aug 2006 10:19:12 +0000 Subject: 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 --- src/modules/m_watch.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') 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++) -- cgit v1.2.3