From 1d70016ef83bc4e63d4bb35a696a2c0aef783c28 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Tue, 24 Jan 2006 00:41:08 +0000 Subject: [PATCH] - Made it so a set::maxbanlength and/or set::maxbans of 0 denies all bans properly, and fixes the first-ban-can-be-as-long-as-you-want bug, both reported by Trocotronic (#2762). --- Changes | 2 ++ src/channel.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Changes b/Changes index d4b9da13f..bc7468f3d 100644 --- a/Changes +++ b/Changes @@ -1000,3 +1000,5 @@ some good testing ;). - Removed some old config.h stuff + clarified some text, reported by Jason (#2765, #2766). ** internal 3.2.4-pre2 release ** +- Made it so a set::maxbanlength and/or set::maxbans of 0 denies all bans properly, and + fixes the first-ban-can-be-as-long-as-you-want bug, both reported by Trocotronic (#2762). diff --git a/src/channel.c b/src/channel.c index 1b6363e42..7206bece2 100644 --- a/src/channel.c +++ b/src/channel.c @@ -369,6 +369,12 @@ int add_listmode(Ban **list, aClient *cptr, aChannel *chptr, char *banid) (void)collapse(banid); len = strlen(banid); + if (!*list && ((len > MAXBANLENGTH) || (MAXBANS < 1))) + { + sendto_one(cptr, err_str(ERR_BANLISTFULL), + me.name, cptr->name, chptr->chname, banid); + return -1; + } for (ban = *list; ban; ban = ban->next) { len += strlen(ban->banstr);