From 837bdbbb0e7e270cfd1d40a7ad730beaffa6c000 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Thu, 7 Jan 2010 02:39:48 +0000 Subject: [PATCH] Fix oplevel handling in bursts, fixing SF bugs #2596869 and #2597518. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1935 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 6 ++++++ ircd/m_burst.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 58cd3ac..ff7157f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-01-06 Michael Poole + + * ircd/m_burst.c (ms_burst): Gracefully handle the case where a + server sends us a too-large oplevel. Forward oplevels whenever + they are in use, not just when the channel is +A. + 2010-01-04 Kevin L. Mitchell * ircd/m_xquery.c (ms_xquery): Resolving my patches with diff --git a/ircd/m_burst.c b/ircd/m_burst.c index 649898d..f1e4429 100644 --- a/ircd/m_burst.c +++ b/ircd/m_burst.c @@ -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'; -- 2.20.1