sw/source/core/layout/frmtool.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
New commits: commit e9534eddcec78e5f6f551c848fa18f07a298ccfa Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Feb 6 12:34:26 2019 +0000 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Thu Feb 7 11:00:03 2019 +0100 Resolves: tdf#123163 avoid null deref one RemoveDrawObjFromPage is already null-deref protected, do the same for the other Change-Id: Ica5bb2df4a8dbffd8397df76b673adab75bb7aef Reviewed-on: https://gerrit.libreoffice.org/67456 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 429a1066044a..98918af9b5f6 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2540,7 +2540,8 @@ static void lcl_RemoveObjsFromPage( SwFrame* _pFrame ) { if (pObj->GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR) { - pObj->GetPageFrame()->RemoveDrawObjFromPage( + if (SwPageFrame *pPg = pObj->GetPageFrame()) + pPg->RemoveDrawObjFromPage( *static_cast<SwAnchoredDrawObject*>(pObj) ); } } @@ -2881,8 +2882,8 @@ static void lcl_Regist( SwPageFrame *pPage, const SwFrame *pAnch ) if ( pPage != pObj->GetPageFrame() ) { // #i28701# - if ( pObj->GetPageFrame() ) - pObj->GetPageFrame()->RemoveDrawObjFromPage( *pObj ); + if (SwPageFrame *pPg = pObj->GetPageFrame()) + pPg->RemoveDrawObjFromPage( *pObj ); pPage->AppendDrawObjToPage( *pObj ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits