diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-08-24 13:56:35 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-08-28 15:38:56 +0200 |
commit | 2c410a04c15c21eb025ae5df0f70f63df9757cca (patch) | |
tree | 88a8d7c33009749eddf31eec917a1f1b3806d13c /xmloff | |
parent | 711cdc36c42a3a9b8d0369c6fd853b8c071bb71a (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/41535
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit f07bb0fed885f7a13c08f2bc3203e727db7cef1c)
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index ccd8158ead14..85c6cfe47289 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1692,6 +1692,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 |