refuse opers setting an invalidly long k-line reason
This commit is contained in:
parent
3fdf26aa19
commit
5a3e99829a
1 changed files with 5 additions and 3 deletions
|
@ -165,6 +165,11 @@ mo_kline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
|
||||||
}
|
}
|
||||||
|
|
||||||
reason = LOCAL_COPY(parv[loc]);
|
reason = LOCAL_COPY(parv[loc]);
|
||||||
|
if(strlen(reason) > BANREASONLEN)
|
||||||
|
{
|
||||||
|
sendto_one_notice(source_p, ":K-Line reason exceeds %d characters", BANREASONLEN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(parse_netmask_strict(host, NULL, NULL) == HM_ERROR)
|
if(parse_netmask_strict(host, NULL, NULL) == HM_ERROR)
|
||||||
{
|
{
|
||||||
|
@ -234,9 +239,6 @@ mo_kline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
|
||||||
aconf->port = 0;
|
aconf->port = 0;
|
||||||
aconf->info.oper = operhash_add(get_oper_name(source_p));
|
aconf->info.oper = operhash_add(get_oper_name(source_p));
|
||||||
|
|
||||||
if(strlen(reason) > BANREASONLEN)
|
|
||||||
reason[BANREASONLEN] = '\0';
|
|
||||||
|
|
||||||
/* Look for an oper reason */
|
/* Look for an oper reason */
|
||||||
if((oper_reason = strchr(reason, '|')) != NULL)
|
if((oper_reason = strchr(reason, '|')) != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue