sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx |   21 ++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 82bc33e819c3f8ac8e9ad2349f8a7a97374d5b2e
Author:     Miklos Vajna <[email protected]>
AuthorDate: Wed Nov 5 08:52:46 2025 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Thu Nov 6 14:22:59 2025 +0100

    sw writerfilter: fix crash in DomainMapper_Impl::PushProperties()
    
    Crashreport signature:
    
    > program/libsw_writerfilterlo.so
    >       writerfilter::dmapper::ParagraphProperties::SetListId(int)
    >               sw/source/writerfilter/dmapper/PropertyMap.hxx:492
    > program/libsw_writerfilterlo.so
    >       std::__uniq_ptr_impl<writerfilter::dmapper::DomainMapper_Impl, 
o3tl::default_delete<writerfilter::dmapper::DomainMapper_Impl> >::_M_ptr() const
    >               
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:191
    > program/libsw_writerfilterlo.so
    >       writerfilter::ooxml::OOXMLFastContextHandler::startParagraphGroup()
    >               sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:432
    > program/libsw_writerfilterlo.so
    >       
writerfilter::ooxml::OOXMLFactory_wml::startAction(writerfilter::ooxml::OOXMLFastContextHandler*)
    >               
workdir/CustomTarget/sw/source/writerfilter/ooxml/OOXMLFactory_wml.cxx:7950
    
    Where gdb (on the coredump) says pParaContext was nullptr in
    writerfilter::dmapper::DomainMapper_Impl::PushProperties().
    
    Change-Id: I5729f95526b9080bcab1f65f5c3aea571d55c4d1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193463
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit bd4185449b074ad553123986d2670c233088d235)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193469
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index 3bca1637c980..53d4418e8168 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -1299,15 +1299,18 @@ void    DomainMapper_Impl::PushProperties(ContextType 
eId)
         if (!IsFirstRun())
         {
             auto pParaContext = 
static_cast<ParagraphPropertyMap*>(GetTopContextOfType(eId).get());
-            pParaContext->props().SetListId(-1);
-            pParaContext->Erase(PROP_NUMBERING_RULES); // only true with 
column, not page break
-            pParaContext->Erase(PROP_NUMBERING_LEVEL);
-            pParaContext->Erase(PROP_NUMBERING_TYPE);
-            pParaContext->Erase(PROP_START_WITH);
-
-            pParaContext->Insert(PROP_PARA_TOP_MARGIN, 
uno::Any(sal_uInt32(0)));
-            pParaContext->Erase(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING);
-            pParaContext->Insert(PROP_PARA_FIRST_LINE_INDENT, 
uno::Any(sal_uInt32(0)));
+            if (pParaContext)
+            {
+                pParaContext->props().SetListId(-1);
+                pParaContext->Erase(PROP_NUMBERING_RULES); // only true with 
column, not page break
+                pParaContext->Erase(PROP_NUMBERING_LEVEL);
+                pParaContext->Erase(PROP_NUMBERING_TYPE);
+                pParaContext->Erase(PROP_START_WITH);
+
+                pParaContext->Insert(PROP_PARA_TOP_MARGIN, 
uno::Any(sal_uInt32(0)));
+                pParaContext->Erase(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING);
+                pParaContext->Insert(PROP_PARA_FIRST_LINE_INDENT, 
uno::Any(sal_uInt32(0)));
+            }
         }
 
         m_aPropertyStacks[eId].push( GetTopContextOfType(eId));

Reply via email to