]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-mode.c
SECURITY: Fixed a message handling bug which could crash the daemon.
[ngircd-alex.git] / src / ngircd / irc-mode.c
index 3786e3994593c53aa41c4e3d067190a136a61ee1..f4e3e0f92696bde34fc02b76de825c99585ed00d 100644 (file)
@@ -286,6 +286,11 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
        long l;
        size_t len;
 
+       /* Are modes allowed on channel? */
+       if (Channel_Name(Channel)[0] == '+')
+               return IRC_WriteStrClient(Client, ERR_NOCHANMODES_MSG,
+                               Client_ID(Client), Channel_Name(Channel));
+
        /* Mode request: let's answer it :-) */
        if (Req->argc <= 1)
                return Channel_Mode_Answer_Request(Origin, Channel);