summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-24 13:56:35 +0200
committerMichael Stahl <mstahl@redhat.com>2017-08-24 15:07:56 +0200
commit9fe857b7bd126ff4856fc4689d375881653b97a2 (patch)
treeb0303fed37611a05a93164af4a995ce070a784a2
parent49877dc91b2f91baa656facd462ac1b1e832f182 (diff)
tdf#111934 xmloff: ODF import: self-referential conditional style crash
It's invalid input and also causes stack overflow. Change-Id: Ie0b9dcaefcfcf254326151f345f4802ed66b994d
-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 25d54ecf4252..6a3d997f8fe5 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1659,6 +1659,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