]> jfr.im git - irc/freenode/ircd-seven.git/commitdiff
m_kline: insert a safety zero early origin/kline-zero
authorEd Kellett <redacted>
Thu, 25 Jun 2020 11:32:01 +0000 (12:32 +0100)
committerEd Kellett <redacted>
Thu, 25 Jun 2020 11:32:01 +0000 (12:32 +0100)
modules/m_kline.c

index 36cebbb699290b9d4d172290d2f57ec591491131..339903e30c34a50eabf8cb58c6f3450e99ffbdac 100644 (file)
@@ -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;
@@ -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"))