]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
More secure checking in 005 handlers
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 3 Apr 2005 21:26:22 +0000 (21:26 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 3 Apr 2005 21:26:22 +0000 (21:26 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@968 e03df62e-2008-0410-955e-edbf42e46eb7

13 files changed:
src/modules/m_blockcolor.cpp
src/modules/m_censor.cpp
src/modules/m_chanprotect.cpp
src/modules/m_knock.cpp
src/modules/m_noctcp.cpp
src/modules/m_noinvite.cpp
src/modules/m_nokicks.cpp
src/modules/m_nonicks.cpp
src/modules/m_nonotice.cpp
src/modules/m_operchans.cpp
src/modules/m_redirect.cpp
src/modules/m_services.cpp
src/modules/m_stripcolor.cpp

index dc86d6e1539c4d6948ade0ffa8988afaa9eb31a6..d8399f3c1789fbe8bc0fde243cd28ec6c749f2d2 100644 (file)
@@ -49,7 +49,8 @@ class ModuleBlockColor : public Module
                        }
                        temp2 = temp2 + temp1 + " ";
                }
-               output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
        
        virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text)
index 8a0bc4d9eef5ecd3fdbafeb4d028f86466a66a9b..9598728198237734ed147b34d53709ac629f8e20 100644 (file)
@@ -64,7 +64,8 @@ class ModuleCensor : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
 
 
index 698e2fbc173e45e864d5c4feece9661cba679162..b7765012e0022ea6fb3cb49a6230ac743058fb46 100644 (file)
@@ -65,7 +65,8 @@ class ModuleChanProtect : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
 
        virtual void OnUserPart(userrec* user, chanrec* channel)
index 474dd4014aad49305618933d634f968fbb69c1c1..6023da0ec6eaa696f1a785d088cf4a70e1b1ca45 100644 (file)
@@ -80,7 +80,9 @@ class ModuleKnock : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1) + std::string(" KNOCK");
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1) + std::string(" KNOCK")
+               else output = output + std::string(" KNOCK");
         }
 
        virtual ~ModuleKnock()
index a5b8832af387894983197bf801133dd59af8527c..ea6eff6bc69f7ff00c51175f543f3c7a1480bbe6 100644 (file)
@@ -48,7 +48,8 @@ class ModuleNoCTCP : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
        
        virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text)
index 463d5a5b92ff55788ca6010d5700b5121f16b446..5424c6958cb6cd221b89be7fbbb5a406f8e91427 100644 (file)
@@ -48,7 +48,8 @@ class ModuleNoInvite : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
 
 
index e049512f9aea50d5bfde55e59ba68687fb496aa7..1afabd182052cf4d27288589f8a95259b382e68d 100644 (file)
@@ -48,7 +48,8 @@ class ModuleNoKicks : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
 
        virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type)
index dfdf86b6172de936421ed1f203fe448b8c5efd4b..d458e15d00caed6bd464ce38557aa15b07f17ac0 100644 (file)
@@ -59,7 +59,8 @@ class ModuleNoNickChange : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
        
        virtual int OnUserPreNick(userrec* user, std::string newnick)
index 6d8e8a4019ffa26bc7f037e6c1e0de98e339222f..b346553b6fcae80202daadc81b2359f63f813cf5 100644 (file)
@@ -69,7 +69,8 @@ class ModuleNoNotice : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
 
        virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params)
index e5eefe0cf77357ec160443c9896615e5e2a2bbd5..ed12c1c3d27e87ab6013ccf5fe8f820c34b642dd 100644 (file)
@@ -74,7 +74,8 @@ class ModuleOperChans : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
        
        virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
index b6b4062e2f75b3069f5a8b4319dceb4ac911c31d..3efe33c09bbb69050c1e6fe2694a3588e1ae141d 100644 (file)
@@ -72,7 +72,8 @@ class ModuleRedirect : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
        
        virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
index d3e9066e81a6c3c15c2f44112a6df3a611099dc9..801ab1fd9f4846eda62fc58798ca57a029a123ce 100644 (file)
@@ -53,7 +53,8 @@ class ModuleServices : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
        
        virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params)
index ba914c75ef35b3a02bddb28383a360c1ff4a78a8..cd883c9c372a0a9169cf495baf94e32982ed5e40 100644 (file)
@@ -64,7 +64,8 @@ class ModuleStripColor : public Module
                         }
                         temp2 = temp2 + temp1 + " ";
                 }
-                output = temp2.substr(0,temp2.length()-1);
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
         }
        
        virtual ~ModuleStripColor()