Channel modes: really break handling when MAX_CMODES_ARG is hit
authorAlexander Barton <alex@barton.de>
Fri, 6 Jan 2012 16:42:52 +0000 (17:42 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 6 Jan 2012 16:43:20 +0000 (17:43 +0100)
This fixes 98493077.

src/ngircd/irc-mode.c

index 9afe90780188ba1941874d9796427323af852816..7eb81cfad680b19732518c106c6ccceedbda4c40 100644 (file)
@@ -492,7 +492,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                        break;
                case 'k': /* Channel key */
                        if (mode_arg_count++ >= MAX_CMODES_ARG)
-                               break;
+                               goto chan_exit;
                        if (!set) {
                                if (modeok)
                                        x[0] = *mode_ptr;
@@ -528,7 +528,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                        break;
                case 'l': /* Member limit */
                        if (mode_arg_count++ >= MAX_CMODES_ARG)
-                               break;
+                               goto chan_exit;
                        if (!set) {
                                if (modeok)
                                        x[0] = *mode_ptr;
@@ -640,7 +640,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
                case 'I': /* Invite lists */
                case 'b': /* Ban lists */
                        if (mode_arg_count++ >= MAX_CMODES_ARG)
-                               break;
+                               goto chan_exit;
                        if (arg_arg > mode_arg) {
                                /* modify list */
                                if (modeok) {