]> jfr.im git - solanum.git/commitdiff
Make sure to check the length of a ban mask before removing a forward channel.
authorJilles Tjoelker <redacted>
Sun, 25 Sep 2011 14:25:17 +0000 (16:25 +0200)
committerJilles Tjoelker <redacted>
Sun, 25 Sep 2011 14:25:17 +0000 (16:25 +0200)
Otherwise a line might be truncated later, leading to desyncs.

src/chmode.c

index 2ba95c596c326d0a87115a90619b13769166c02f..0e4b6975b915730f7dfb0298a0d926b470b84a4d 100644 (file)
@@ -807,6 +807,13 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
        else
                mask = pretty_mask(raw_mask);
 
+       /* we'd have problems parsing this, hyb6 does it too
+        * also make sure it will always fit on a line with channel
+        * name etc.
+        */
+       if(strlen(mask) > IRCD_MIN(BANLEN, MODEBUFLEN - 5))
+               return;
+
        /* Look for a $ after the first character.
         * As the first character, it marks an extban; afterwards
         * it delimits a forward channel.
@@ -818,13 +825,6 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
                        forward = NULL;
        }
 
-       /* we'd have problems parsing this, hyb6 does it too
-        * also make sure it will always fit on a line with channel
-        * name etc.
-        */
-       if(strlen(mask) > IRCD_MIN(BANLEN, MODEBUFLEN - 5))
-               return;
-
        /* if we're adding a NEW id */
        if(dir == MODE_ADD)
        {