summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-29 08:50:57 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-29 08:50:57 +0000
commit96bf59631c7a17d9f0e99847a33df85a279aae4d (patch)
tree7576cbff37832a00d504938d3fade70440e305ab /src/inspircd.cpp
parent483ec8439c6564f8e3783223a01c641326b6f2d8 (diff)
Added some pretty mean anti-flood features
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1261 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 2558f3efc..3c2ab09a8 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -4112,6 +4112,7 @@ int InspIRCd(void)
log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
kill_link(current,"Excess flood");
+ goto label;
}
if ((floodlines > current->flood) && (current->flood != 0))
{
@@ -4130,7 +4131,15 @@ int InspIRCd(void)
}
char sanitized[MAXBUF];
// use GetBuffer to copy single lines into the sanitized string
- strlcpy(sanitized,current->GetBuffer().c_str(),MAXBUF);
+ std::string single_line = current->GetBuffer();
+ if (single_line.length()>512)
+ {
+ log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
+ WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
+ kill_link(current,"Excess flood");
+ goto label;
+ }
+ strlcpy(sanitized,single_line.c_str(),MAXBUF);
if (*sanitized)
{
// we're gonna re-scan to check if the nick is gone, after every