summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-12 14:01:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-12 21:36:39 +0100
commit22fc8c634c5f9b09d45aff0403503f4d8226328d (patch)
treeccfa6bab78e329b76183db2ecd52b5a1696cef64 /lotuswordpro
parent10b6a2b2d6a5cb938ead02cba2fa03f748c5f63c (diff)
ofz#6208 Indirect-leak
Change-Id: I8d6761bd951cc1ddd4a45eabb26428bc40c2271a Reviewed-on: https://gerrit.libreoffice.org/49600 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/inc/xfilter/xfcontent.hxx3
-rw-r--r--lotuswordpro/qa/cppunit/data/fail/ofz6208-1.lwpbin0 -> 21428 bytes
-rw-r--r--lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx9
3 files changed, 9 insertions, 3 deletions
diff --git a/lotuswordpro/inc/xfilter/xfcontent.hxx b/lotuswordpro/inc/xfilter/xfcontent.hxx
index 611f9daaa719..38021b4fcd7a 100644
--- a/lotuswordpro/inc/xfilter/xfcontent.hxx
+++ b/lotuswordpro/inc/xfilter/xfcontent.hxx
@@ -105,6 +105,7 @@ public:
protected:
XFContent()
: m_bDoingToXml(false)
+ , m_bInserted(false)
{
}
@@ -115,6 +116,8 @@ protected:
OUString m_strStyleName;
private:
bool m_bDoingToXml;
+public:
+ bool m_bInserted;
};
#endif
diff --git a/lotuswordpro/qa/cppunit/data/fail/ofz6208-1.lwp b/lotuswordpro/qa/cppunit/data/fail/ofz6208-1.lwp
new file mode 100644
index 000000000000..5b068065a1f0
--- /dev/null
+++ b/lotuswordpro/qa/cppunit/data/fail/ofz6208-1.lwp
Binary files differ
diff --git a/lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx b/lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx
index 67dc59017343..b1398bc023cd 100644
--- a/lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx
@@ -68,8 +68,11 @@ XFContentContainer::~XFContentContainer()
{
}
-void XFContentContainer::Add(XFContent *pContent)
+void XFContentContainer::Add(XFContent *pContent)
{
+ if (pContent->m_bInserted)
+ throw std::runtime_error("already inserted");
+ pContent->m_bInserted = true;
m_aContents.emplace_back(pContent);
}
@@ -80,12 +83,12 @@ void XFContentContainer::Add(const OUString& text)
Add(xTC.get());
}
-int XFContentContainer::GetCount() const
+int XFContentContainer::GetCount() const
{
return m_aContents.size();
}
-void XFContentContainer::Reset()
+void XFContentContainer::Reset()
{
m_aContents.clear();
}