diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-03 21:26:22 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-03 21:26:22 +0000 |
commit | 87bba3d377a99fef1e22a96a8ac403c9aad6efbd (patch) | |
tree | 6722b4f6b671e37813f2d11979ebc96019aa3d3a /src | |
parent | f3d1e3ce6e158aee03fb378b2ca31032c5cc7521 (diff) |
More secure checking in 005 handlers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@968 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_blockcolor.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_censor.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_chanprotect.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_knock.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_noctcp.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_noinvite.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_nokicks.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_nonicks.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_nonotice.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_operchans.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_redirect.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_services.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_stripcolor.cpp | 3 |
13 files changed, 27 insertions, 13 deletions
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index dc86d6e15..d8399f3c1 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -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) diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 8a0bc4d9e..959872819 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -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); } diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 698e2fbc1..b7765012e 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -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) diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 474dd4014..6023da0ec 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -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() diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index a5b8832af..ea6eff6bc 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -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) diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp index 463d5a5b9..5424c6958 100644 --- a/src/modules/m_noinvite.cpp +++ b/src/modules/m_noinvite.cpp @@ -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); } diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp index e049512f9..1afabd182 100644 --- a/src/modules/m_nokicks.cpp +++ b/src/modules/m_nokicks.cpp @@ -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) diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index dfdf86b61..d458e15d0 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -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) diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 6d8e8a401..b346553b6 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -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 ¶ms) diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index e5eefe0cf..ed12c1c3d 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -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) diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index b6b4062e2..3efe33c09 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -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) diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index d3e9066e8..801ab1fd9 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -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 ¶ms) diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp index ba914c75e..cd883c9c3 100644 --- a/src/modules/m_stripcolor.cpp +++ b/src/modules/m_stripcolor.cpp @@ -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() |