[Libreoffice-commits] core.git: xmloff/source

Michael Stahl mstahl at redhat.com
Thu Aug 24 13:11:34 UTC 2017


 xmloff/source/style/xmlnumfi.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 9fe857b7bd126ff4856fc4689d375881653b97a2
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Aug 24 13:56:35 2017 +0200

    tdf#111934 xmloff: ODF import: self-referential conditional style crash
    
    It's invalid input and also causes stack overflow.
    
    Change-Id: Ie0b9dcaefcfcf254326151f345f4802ed66b994d

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


More information about the Libreoffice-commits mailing list