Fix SF#1704458 by sending a protocol violation on the input in question.
authorMichael Poole <mdpoole@troilus.org>
Sun, 20 May 2007 14:40:33 +0000 (14:40 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sun, 20 May 2007 14:40:33 +0000 (14:40 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1811 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_burst.c

index 7116278c56058eeb902e088b32f6ba69e1244999..c8d73ef489d141360713197bd0a765518cba1d8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-20  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/m_burst.c (netride_modes): Return -1 if someone tries to
+       remove modes in the burst.
+       (ms_burst): Check for, and handle, that protocol violation.
+
 2007-05-20  Michael Poole <mdpoole@troilus.org>
 
        * ircd/m_privs.c (mo_privs): Report "no such nickname" for unknown
index e95a0696971eaf43f9f6c2984602073c7f974e40..262e247069f6ca1ec9382128dc3a29c93a8e6c16 100644 (file)
@@ -115,6 +115,8 @@ netride_modes(int parc, char **parv, const char *curr_key)
   assert(modes && modes[0] == '+');
   while (*modes) {
     switch (*modes++) {
+    case '-':
+      return -1;
     case 'i':
       result |= MODE_INVITEONLY;
       break;
@@ -282,7 +284,13 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       if (parv[param][0] != '+')
         continue;
       check_modes = netride_modes(parc - param, parv + param, chptr->mode.key);
-      if (check_modes)
+      if (check_modes < 0)
+      {
+        if (chptr->users == 0)
+          sub1_from_channel(chptr);
+        return protocol_violation(sptr, "Invalid mode string in BURST");
+      }
+      else if (check_modes)
       {
         /* Clear any outstanding rogue invites */
         mode_invite_clear(chptr);