summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-03-27 20:51:48 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-05-16 12:40:01 +0200
commitfc8c05dbf712b302e7dab76f275d44b75014afc4 (patch)
tree0a29db202ff9e04f591bc1b28cc471f7989d4c50
parentc820483e2940e01823e549588b4b2ad34f919360 (diff)
forcepoint#94 fix crash on layout of specific html
Change-Id: I1874a431d5af9d56248a695e08a2f95b5292ba9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132179 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 3b6ea366796f7f7e04fb60b9394c91e4790b5c72) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133940 Tested-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/qa/extras/layout/data/forcepoint94.htmlbin0 -> 12370 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx8
-rw-r--r--sw/source/core/layout/ftnfrm.cxx3
3 files changed, 11 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint94.html
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index bd394317ad41..e565e31df9b0 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3059,6 +3059,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testN4LA0OHZ) { createDoc("LIBREOFFICE-N4LA
//just care it doesn't crash/assert
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92) { createDoc("forcepoint92.doc"); }
+#if 0 // no createSwWebDoc
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint94)
+{
+ createSwWebDoc(DATA_DIRECTORY, "forcepoint94.html");
+}
+#endif
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058)
{
SwDoc* pDoc = createDoc("tdf118058.fodt");
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 425aa5fd0a9e..964af2008868 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2873,6 +2873,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() );
}
}