m_kline: insert a safety zero early

This commit is contained in:
Ed Kellett 2020-06-25 12:32:01 +01:00
parent 3ef1213be4
commit 8e1e48e114
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC

View file

@ -99,7 +99,7 @@ mo_kline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
{
char def[] = "No Reason";
char user[USERLEN + 2];
char host[HOSTLEN + 2];
char host_buf[HOSTLEN + 3], *host = host_buf + 1;
char *reason = def;
char *oper_reason;
const char *target_server = NULL;
@ -123,6 +123,12 @@ mo_kline(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
if(find_user_host(source_p, parv[loc], user, host) == 0)
return;
if (*host == ':')
{
host--;
*host = '0';
}
loc++;
if(parc >= loc + 2 && !irccmp(parv[loc], "ON"))