[Libreoffice-commits] core.git: 2 commits - sd/source sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Sun Apr 28 14:03:21 UTC 2019


 sd/source/ui/view/drtxtob1.cxx |    4 +++-
 sw/source/core/doc/doclay.cxx  |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 6be4694ab84217d195091d2b9a0e7c74199f5fc1
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Apr 28 13:26:21 2019 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sun Apr 28 16:02:44 2019 +0200

    tdf#120703 PVS: nullptr dereference
    
    V595 The 'pContact' pointer was utilized before it was verified against nullptr.
         Check lines: 1254, 1256.
    
    Change-Id: I5d3d28b3c8a70924f329fde9f020f42d9eb5e9a1
    Reviewed-on: https://gerrit.libreoffice.org/71459
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index ec866b0c4e83..cad5209f32a2 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1253,10 +1253,10 @@ SwFlyFrameFormat* SwDoc::InsertDrawLabel(
 {
     SwDrawContact *const pContact =
         static_cast<SwDrawContact*>(GetUserCall( &rSdrObj ));
-    OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFormat()->Which(),
-            "InsertDrawLabel(): not a DrawFrameFormat" );
     if (!pContact)
         return nullptr;
+    OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFormat()->Which(),
+            "InsertDrawLabel(): not a DrawFrameFormat" );
 
     SwDrawFrameFormat* pOldFormat = static_cast<SwDrawFrameFormat *>(pContact->GetFormat());
     if (!pOldFormat)
commit 51aada2a6f2cacf0134e14bd6559bc71c746c4a5
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Apr 28 14:13:25 2019 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sun Apr 28 16:02:15 2019 +0200

    tdf#120703 PVS: dereference before nullptr check
    
    V595 The 'mpViewShell' pointer was utilized before it was verified against nullptr.
         Check lines: 96, 125.
    
    Change-Id: I824c6cf8a5ed7f0ef20e99df36c83feec7fe54ea
    Reviewed-on: https://gerrit.libreoffice.org/71468
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index 4cfe98f8431a..629cecbecfd3 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -92,6 +92,8 @@ void TextObjectBar::Execute( SfxRequest &rReq )
 
     std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard;
 
+    assert(mpViewShell);
+
     if( dynamic_cast< const OutlineView *>( mpView ) !=  nullptr)
     {
         pOLV = static_cast<OutlineView*>(mpView)
@@ -124,7 +126,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
             }
             else
             {
-                if( mpViewShell && mpViewShell->GetViewFrame() )
+                if (mpViewShell->GetViewFrame())
                     mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SfxCallMode::ASYNCHRON );
             }
 


More information about the Libreoffice-commits mailing list