[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-common-dev
Subject: [Common-dev] CN-Client: fix ASMRuleBook bug
From: "Eric Hyche" <ehyche () real ! com>
Date: 2007-11-21 19:56:05
Message-ID: 00be01c82c78$8e4cbab0$db68a8c0 () EHYCHED620
[Download RAW message or body]
This is now checked into HEAD, 150Cay, 203Cay,
204Cay, and 310Atlas.
Eric
=============================================
Eric Hyche (ehyche@real.com)
Technical Lead
RealNetworks, Inc.
> -----Original Message-----
> From: Henry Ping [mailto:ping@real.com]
> Sent: Wednesday, November 21, 2007 12:53 PM
> To: ehyche@real.com; common-dev@lists.helixcommunity.org;
> client-dev@lists.helixcommunity.org
> Subject: RE: [Client-dev] CR-Client: fix ASMRuleBook bug
>
> Looks good.
>
> Henry
>
> > -----Original Message-----
> > From: client-dev-bounces@helixcommunity.org [mailto:client-dev-
> > bounces@helixcommunity.org] On Behalf Of Eric Hyche
> > Sent: Wednesday, November 21, 2007 9:28 AM
> > To: common-dev@lists.helixcommunity.org; client-
> > dev@lists.helixcommunity.org
> > Subject: [Client-dev] CR-Client: fix ASMRuleBook bug
> >
> >
> > Description
> > ---------------------------------------
> > ASMRuleBook class does not check whether any
> > rules were actually found when parsing, and
> > does not check certain variables before deleting them.
> > Client core was not checking for a number of rules > 0
> > before allocating structures.
> >
> > Files Modified
> > ---------------------------------------
> > common/util/asmrulep.cpp
> > client/core/asm/hxsmstr.cpp
> >
> > Branches
> > ---------------------------------------
> > HEAD, 150Cay, 203Cay, 204Cay, 310Atlas
> >
> > Index: asmrulep.cpp
> > ===================================================================
> > RCS file: /cvsroot/common/util/asmrulep.cpp,v
> > retrieving revision 1.17.6.6
> > diff -u -w -r1.17.6.6 asmrulep.cpp
> > --- asmrulep.cpp 27 Sep 2005 09:52:07 -0000 1.17.6.6
> > +++ asmrulep.cpp 21 Nov 2007 17:24:43 -0000
> > @@ -724,6 +724,9 @@
> >
> > ASMRuleBook::ASMRuleBook(const char* pRuleBook)
> > : m_LastError(HXR_OK)
> > +, m_pRules(NULL)
> > +, m_unNumRules(0)
> > +, m_ulNumThresholds(0)
> > , m_pValidRulesArray(NULL)
> > , m_pDeletedRulesArray(NULL)
> > , m_pRuleBook(NULL)
> > @@ -749,6 +752,8 @@
> > }
> >
> > m_unNumRules = i;
> > + if (i > 0)
> > + {
> > m_pRules = new ASMRule[i];
> > if(!m_pRules)
> > {
> > @@ -772,11 +777,12 @@
> >
> > m_LastError = Reset();
> > }
> > +}
> >
> >
> > ASMRuleBook::~ASMRuleBook()
> > {
> > - delete [] m_pRules;
> > + HX_VECTOR_DELETE(m_pRules);
> > if( m_pValidRulesArray )
> > {
> > HX_VECTOR_DELETE(m_pValidRulesArray);
> > @@ -1096,7 +1102,7 @@
> > HX_RESULT
> > ASMRuleBook::InitRulesArray()
> > {
> > - if( !m_pValidRulesArray )
> > + if( !m_pValidRulesArray && m_unNumRules)
> > {
> > m_pValidRulesArray = new BOOL[ m_unNumRules ];
> > if(!m_pValidRulesArray)
> > @@ -1109,7 +1115,7 @@
> > m_pValidRulesArray[ii] = TRUE;
> > }
> > }
> > - if( !m_pDeletedRulesArray )
> > + if( !m_pDeletedRulesArray && m_unNumRules)
> > {
> > m_pDeletedRulesArray = new BOOL[ m_unNumRules ];
> > if(!m_pDeletedRulesArray)
> > @@ -1446,6 +1452,7 @@
> > ASMRuleBook::Reset()
> > {
> > int i = 0;
> > + if (m_pRuleBook)
> > { //XXXSMPNOW
> > BOOL bSeenExpression = 0;
> >
> >
> > Index: asm/hxsmstr.cpp
> > ===================================================================
> > RCS file: /cvsroot/client/core/asm/hxsmstr.cpp,v
> > retrieving revision 1.16.2.2
> > diff -u -w -r1.16.2.2 hxsmstr.cpp
> > --- asm/hxsmstr.cpp 8 Mar 2005 06:05:51 -0000 1.16.2.2
> > +++ asm/hxsmstr.cpp 21 Nov 2007 17:25:30 -0000
> > @@ -181,12 +181,15 @@
> > m_pRuleBook = new ASMRuleBook ((const char *)pRuleBook-
> > >GetBuffer());
> >
> > m_nNumRules = m_pRuleBook->GetNumRules();
> > + if (m_nNumRules > 0)
> > + {
> > m_ulRuleBw = new UINT32[m_nNumRules];
> > m_ulRulePreData = new UINT32[m_nNumRules];
> > m_bRuleTimeStampDelivery = new BOOL[m_nNumRules];
> > m_pSubInfo = new BOOL[m_nNumRules];
> > m_pRuleSubscribeStatus = new BOOL[m_nNumRules];
> > m_pRuleEnableState = new RuleEnableState[m_nNumRules];
> > + }
> >
> > for (UINT16 i = 0; i < m_nNumRules; i++)
> > {
> >
> >
> > =====================================
> > Eric Hyche, Technical Lead
> > RealNetworks, Inc.
> > ehyche@real.com
> >
> >
> > _______________________________________________
> > Client-dev mailing list
> > Client-dev@helixcommunity.org
> > http://lists.helixcommunity.org/mailman/listinfo/client-dev
>
_______________________________________________
Common-dev mailing list
Common-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/common-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic