sw/qa/extras/layout/data/forcepoint94.html |binary
 sw/qa/extras/layout/layout.cxx             |    6 ++++++
 sw/source/core/layout/ftnfrm.cxx           |    3 +++
 3 files changed, 9 insertions(+)

New commits:
commit 4085bbbb895060f085a58e6275201015b84e3532
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Mar 27 20:51:48 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Mar 28 21:36:29 2022 +0200

    forcepoint#94 fix crash on layout of specific html
    
    Change-Id: I1874a431d5af9d56248a695e08a2f95b5292ba9a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132153
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/qa/extras/layout/data/forcepoint94.html 
b/sw/qa/extras/layout/data/forcepoint94.html
new file mode 100644
index 000000000000..8be788f8e4e5
Binary files /dev/null and b/sw/qa/extras/layout/data/forcepoint94.html differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 85fd9cbcae06..e0530dc58541 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2521,6 +2521,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92)
     createSwDoc(DATA_DIRECTORY, "forcepoint92.doc");
 }
 
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint94)
+{
+    createSwWebDoc(DATA_DIRECTORY, "forcepoint94.html");
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058)
 {
     SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf118058.fodt");
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 987a437a586f..db4c4f9213d9 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2861,6 +2861,9 @@ bool SwContentFrame::MoveFootnoteCntFwd( bool bMakePage, 
SwFootnoteBossFrame *pO
                             OSL_ENSURE( pTmp->IsTabFrame(), "GetNextSctLeaf: 
Wrong Type" );
                             pTmpNxt = static_cast<SwTabFrame*>(pTmp);
                         }
+                        // we will dereference pNewUp in the following 
MoveSubTree call
+                        // so it certainly should not be deleted before that
+                        SwFrameDeleteGuard aDeleteGuard(pNewUp);
                         pTmpNxt->MoveSubTree( pTmpFootnote, pNewUp->GetNext() 
);
                     }
                 }

Reply via email to