]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
More fixes to cross-server mode handling
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 10 Apr 2004 20:50:51 +0000 (20:50 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 10 Apr 2004 20:50:51 +0000 (20:50 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@512 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd.cpp

index ba511e583adc2d2709b67b6497bdfff9742497c4..904cae4bebc98888e516a6606bc30cb0b90bc220 100644 (file)
@@ -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);
                }
        }
 }