From 07ccbd0fb442ddc7cb6647def7c64cb1de9cc1e8 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 10 Apr 2004 20:50:51 +0000 Subject: More fixes to cross-server mode handling git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@512 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index ba511e583..904cae4be 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -6007,6 +6007,18 @@ void handle_m(char token,char* params,serverrec* source,serverrec* reply, char* char* pars[128]; char original[MAXBUF]; strncpy(original,params,MAXBUF); + + if (!strchr(params,' ')) + { + WriteOpers("WARNING! 'm' token in data stream without any parameters! Something fishy is going on!"); + return; + } + + char* o = original; + while (o != ' ') + o++; + o++; + int index = 0; char* src = strtok(params," "); @@ -6027,12 +6039,12 @@ void handle_m(char token,char* params,serverrec* source,serverrec* reply, char* if (FindChan(pars[0])) { log(DEBUG,"Target is channel"); - WriteChannelLocal(FindChan(pars[0]), user, "MODE %s",original); + WriteChannelLocal(FindChan(pars[0]), user, "MODE %s",o); } if (Find(pars[0])) { log(DEBUG,"Target is nick"); - WriteTo(user,Find(pars[0]),"MODE %s",original); + WriteTo(user,Find(pars[0]),"MODE %s",o); } } } -- cgit v1.2.3