mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-05 11:53:13 +02:00
- 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).
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user