diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-10 10:00:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-10 10:01:20 +0000 |
commit | fbd329800340a496def839181858964b1e3709a5 (patch) | |
tree | e05da6d3c1af06473243f188e9ec3376899875fc /lotuswordpro/source/filter/lwpobj.hxx | |
parent | b8d86c976c2356bb3c63830ffed204a397ffd0ae (diff) |
guard against infinite recursion on parsing objects
Change-Id: Ia6502afde54dbf379bc9951c80c6594f1f436ef5
Diffstat (limited to 'lotuswordpro/source/filter/lwpobj.hxx')
-rw-r--r-- | lotuswordpro/source/filter/lwpobj.hxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpobj.hxx b/lotuswordpro/source/filter/lwpobj.hxx index 884ab4265112..bcd6136ac33e 100644 --- a/lotuswordpro/source/filter/lwpobj.hxx +++ b/lotuswordpro/source/filter/lwpobj.hxx @@ -91,9 +91,11 @@ protected: LwpFoundry* m_pFoundry; LwpSvStream* m_pStrm; bool m_bRegisteringStyle; + bool m_bParsingStyle; protected: virtual void Read(); virtual void RegisterStyle(); + virtual void Parse(IXFStream* pOutputStream); public: void QuickRead(); //calls RegisterStyle but bails if DoRegisterStyle is called @@ -106,7 +108,17 @@ public: RegisterStyle(); m_bRegisteringStyle = false; } - virtual void Parse(IXFStream* pOutputStream); + //calls Parse but bails if DoParse is called + //on the same object recursively + void DoParse(IXFStream* pOutputStream) + { + if (m_bParsingStyle) + throw std::runtime_error("recursion in parsing"); + m_bParsingStyle = true; + Parse(pOutputStream); + m_bParsingStyle = false; + } + virtual void XFConvert(XFContentContainer* pCont); LwpFoundry* GetFoundry(){return m_pFoundry;} |