Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.

m_kline: insert a safety zero early #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/m_kline.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mo_kline(struct Client *client_p, struct Client *source_p, int parc, const char
{
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;
Expand All @@ -125,6 +125,12 @@ mo_kline(struct Client *client_p, struct Client *source_p, int parc, const char
if(find_user_host(source_p, parv[loc], user, host) == 0)
return 0;

if (*host == ':')
{
host--;
*host = '0';
}

loc++;

if(parc >= loc + 2 && !irccmp(parv[loc], "ON"))
Expand Down