diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-08-24 13:56:35 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-08-25 19:40:25 +0200 |
commit | 1e264bb2bf0dc9d173abff02a078f089669d95cd (patch) | |
tree | 44d6c9d6d830cface2dbd11a8dddec504612c4f9 | |
parent | 1403f09257f502acaff7f0c1ea4dd15fb0eda9a4 (diff) |
tdf#111934 xmloff: ODF import: self-referential conditional style crash
It's invalid input and also causes stack overflow.
(cherry picked from commit 9fe857b7bd126ff4856fc4689d375881653b97a2)
tdf#111934: add document for filters-tests
Thanks to infostud91@gmail.com for the document; unfortunately git
tells me that i can't set the commit author to just an email address.
(cherry picked from commit 6e090b4272b8fa12d2032ff0c0ea4bfb24c0d2d2)
Change-Id: Ie0b9dcaefcfcf254326151f345f4802ed66b994d
Reviewed-on: https://gerrit.libreoffice.org/41536
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/core/data/odt/fail/82fff64a-0a21-4b09-bbdc-2914a5a150f0.odt | bin | 0 -> 2202 bytes | |||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 5 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/core/data/odt/fail/82fff64a-0a21-4b09-bbdc-2914a5a150f0.odt b/sw/qa/core/data/odt/fail/82fff64a-0a21-4b09-bbdc-2914a5a150f0.odt Binary files differnew file mode 100644 index 000000000000..7d823df75213 --- /dev/null +++ b/sw/qa/core/data/odt/fail/82fff64a-0a21-4b09-bbdc-2914a5a150f0.odt diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index d4805317fb89..7ba9e711f40f 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1660,6 +1660,11 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) { SvXMLNumFormatContext* pStyle = const_cast<SvXMLNumFormatContext*>( static_cast<const SvXMLNumFormatContext *>(pStyles->FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, aMyConditions[i].sMapName))); + if (this == pStyle) + { + SAL_INFO("xmloff.style", "invalid style:map references containing style"); + pStyle = nullptr; + } if (pStyle) { if ((pStyle->PrivateGetKey() > -1)) // don't reset pStyle's bRemoveAfterUse flag |