summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-24 13:56:35 +0200
committerCaolán McNamara <caolanm@redhat.com>2017-08-25 19:39:16 +0200
commitf07bb0fed885f7a13c08f2bc3203e727db7cef1c (patch)
treee9cb1efdc58beace4c159a94c6b737ce19838459 /xmloff
parent706ff0383f865b67d97bffb7f47e54645517c484 (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>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx5
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