diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-02-06 12:34:26 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-02-06 14:53:20 +0100 |
commit | a96014f1365e411d700a7119dca63cdbb51931dc (patch) | |
tree | 695e43a3e5ce55d465ceb11e9028705ad9b3f14f /sw | |
parent | 1ae50279d800f16d38a6bf88c63c6fd14fbd6717 (diff) |
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/67452
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index b4d0948590b0..5728fc345363 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 ); } } |