summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp11
-rw-r--r--src/users.cpp2
2 files changed, 12 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
diff --git a/src/users.cpp b/src/users.cpp
index 40589b234..0ece63bc9 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -40,6 +40,8 @@ userrec::userrec()
strcpy(server,"");
strcpy(awaymsg,"");
strcpy(oper,"");
+ reset_due = TIME;
+ lines_in = 0;
fd = lastping = signon = idle_lastmsg = nping = registered = 0;
flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
haspassed = false;