From 5c3eaed8acdd9d9677833547b2ab206574ee45b8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 13 May 2014 20:58:59 +0100 Subject: coverity#705490 Dereference null return value Change-Id: Iac4178e7f751cba0b4a135dc9d840234d96ccfa2 --- sw/source/core/frmedt/tblsel.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index ce5ad303dd9a..b4ae8009b19c 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -1712,7 +1712,8 @@ static void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart, { pTmpTab = pTmpTab->GetFollow(); rpStart = pTmpTab->FirstCell(); - while ( (rpStart->Frm().*fnRect->fnGetLeft)() < nSX && + while ( rpStart && + (rpStart->Frm().*fnRect->fnGetLeft)() < nSX && (rpStart->Frm().*fnRect->fnGetRight)()< nSX2 ) rpStart = rpStart->GetNextLayoutLeaf(); } @@ -1801,7 +1802,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart, else if( nsSwTblSearchType::TBLSEARCH_COL == ((~nsSwTblSearchType::TBLSEARCH_PROTECT ) & eSearchType ) ) ::lcl_FindStartEndCol( pStart, pEnd, nsSwTblSearchType::TBLSEARCH_PROTECT & eSearchType ); - if ( !pEnd ) return; // Made code robust. + if ( !pEnd || !pStart ) return; // Made code robust. // retrieve again, as they have been moved pTable = pStart->FindTabFrm(); -- cgit