sw/source/core/crsr/crsrsh.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 7ed40b1885868720ece6e702afa2d002614484c1
Author: Caolán McNamara <caol...@redhat.com>
Date:   Mon Jun 11 09:24:27 2018 +0100

    coverity#1436016 Dereference after null check
    
    Change-Id: I5bd8719dcbd501b0f3a196d5aa605a50c0030c6e
    Reviewed-on: https://gerrit.libreoffice.org/55605
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 1158e82afdc8..ebc34e0692ca 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -958,13 +958,12 @@ bool SwCursorShell::TestCurrPam(
 
     // search in all selections for this position
     SwShellCursor* pCmp = m_pCurrentCursor; // keep the pointer on cursor
-    do {
-        if( pCmp && pCmp->HasMark() &&
-            *pCmp->Start() <= aPtPos && *pCmp->End() > aPtPos )
-        {
+    do
+    {
+        if (pCmp->HasMark() && *pCmp->Start() <= aPtPos && *pCmp->End() > 
aPtPos)
             return true;               // return without update
-        }
-    } while( m_pCurrentCursor != ( pCmp = pCmp->GetNext() ) );
+        pCmp = pCmp->GetNext();
+    } while (m_pCurrentCursor != pCmp);
     return false;
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to