1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-03 16:03:12 +02:00

Fix OOB read in extended bans handling.

(Bug caused by commit dd6f67a266)
This commit is contained in:
Bram Matthys
2018-06-11 08:02:35 +02:00
parent 21af7689c0
commit e456f621ef
+3 -3
View File
@@ -1065,7 +1065,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
if (BadPtr(tmpstr))
{
/* Invalid ban. See if we can send an error about that */
if ((param[0] == '~') && MyClient(cptr) && !bounce)
if ((param[0] == '~') && MyClient(cptr) && !bounce && (strlen(param) > 2))
{
Extban *p = findmod_by_bantype(param[1]);
if (p && p->is_ok)
@@ -1113,7 +1113,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
tmpstr = clean_ban_mask(param, what, cptr);
if (BadPtr(tmpstr))
break; /* ignore except, but eat param */
if ((tmpstr[0] == '~') && MyClient(cptr) && !bounce)
if ((tmpstr[0] == '~') && MyClient(cptr) && !bounce && (strlen(param) > 2))
{
/* extban: check access if needed */
Extban *p = findmod_by_bantype(tmpstr[1]);
@@ -1152,7 +1152,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
tmpstr = clean_ban_mask(param, what, cptr);
if (BadPtr(tmpstr))
break; /* ignore except, but eat param */
if ((tmpstr[0] == '~') && MyClient(cptr) && !bounce)
if ((tmpstr[0] == '~') && MyClient(cptr) && !bounce && (strlen(param) > 2))
{
/* extban: check access if needed */
Extban *p = findmod_by_bantype(tmpstr[1]);