[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/source

Caolán McNamara caolanm at redhat.com
Fri Dec 16 09:23:44 UTC 2016


 sw/source/core/draw/dcontact.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f4b7650ecd46e5404b35dccfb8b7d3b0a385d633
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 15 21:21:38 2016 +0000

    coverity#1397207 Dereference before null check
    
    Change-Id: I2578d59e98a2b1b040d9284b0ad0f68fd331d0df
    (cherry picked from commit 7a9d5485a815af26c63790e3165477c68e164117)

diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ded98a2..a62d9a4 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -415,9 +415,9 @@ const SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( const SdrObject* _pSdr
 
     const SwAnchoredObject* pRetAnchoredObj = nullptr;
 
-    if ( _pSdrObj && dynamic_cast<const SwVirtFlyDrawObj*>( _pSdrObj) !=  nullptr )
+    if (const SwVirtFlyDrawObj* pFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>(_pSdrObj))
     {
-        pRetAnchoredObj = static_cast<const SwVirtFlyDrawObj*>(_pSdrObj)->GetFlyFrame();
+        pRetAnchoredObj = pFlyDrawObj->GetFlyFrame();
     }
 
     return pRetAnchoredObj;


More information about the Libreoffice-commits mailing list