diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-17 14:50:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-17 18:53:28 +0100 |
commit | d265bb1554c185ab9cd5bd63e584165e8b3ae0a1 (patch) | |
tree | 49bb8775eed13dcb4eb1d4a8e9c621d5c23d977c /lotuswordpro/source | |
parent | 67f47a55f13ce41cafe7f0eda12c1030d1f0e7de (diff) |
ofz: infinite loop
Change-Id: Icbc19a6761a9972d61db45b779dab56361bf6db8
Reviewed-on: https://gerrit.libreoffice.org/49915
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/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpdoc.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index 6bb3c94aedb5..728df2e413b8 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -562,8 +562,10 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() { LwpDocument* pDivision = GetLastDivision(); + std::set<LwpDocument*> aSeen; while (pDivision && pDivision != this) { + aSeen.insert(pDivision); LwpDocument* pContentDivision = pDivision->GetLastDivisionWithContents(); if (pContentDivision) { @@ -571,6 +573,8 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() break; } pDivision = pDivision->GetPreviousDivision(); + if (aSeen.find(pDivision) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } } |