Fix oplevel handling in bursts, fixing SF bugs #2596869 and #2597518.
[ircu2.10.12-pk.git] / ircd / m_burst.c
index 649898d22b83e586f28728aab3392ddb74b9f53e..f1e4429e32d0d0d9d273478240374f7abb6006f5 100644 (file)
@@ -509,6 +509,11 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
                  } while (IsDigit(*ptr));
                  --ptr;
                  oplevel += level_increment;
+                  if (oplevel > MAXOPLEVEL) {
+                    protocol_violation(sptr, "Invalid cumulative oplevel %u during burst", oplevel);
+                    oplevel = MAXOPLEVEL;
+                    break;
+                  }
                }
                else { /* I don't recognize that flag */
                  protocol_violation(sptr, "Invalid flag '%c' in nick part of burst", *ptr);
@@ -537,7 +542,7 @@ int ms_burst(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
              nickstr[nickpos++] = 'v';
            if (current_mode & CHFL_CHANOP)
             {
-              if (chptr->mode.apass[0])
+              if (oplevel != MAXOPLEVEL)
                nickpos += ircd_snprintf(0, nickstr + nickpos, sizeof(nickstr) - nickpos, "%u", oplevel);
               else
                 nickstr[nickpos++] = 'o';