[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 19 09:15:09 UTC 2019


 sc/source/ui/drawfunc/fuins2.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 4959b71cbc91dbe2c454d1d7bf2092c01c4f0cae
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 18 12:06:20 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jul 19 11:14:26 2019 +0200

    cid#1448351 Use after free
    
    Change-Id: I5591303096a495565e4e3638ca8db8196fa26092
    Reviewed-on: https://gerrit.libreoffice.org/75913
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index c062c0c8f936..21a541285cc1 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -347,9 +347,9 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
                 aName,
                 aRect);
             SdrPageView* pPV = pView->GetSdrPageView();
-            pView->InsertObjectAtView(pObj, *pPV);
+            bool bSuccess = pView->InsertObjectAtView(pObj, *pPV);
 
-            if ( nAspect != embed::Aspects::MSOLE_ICON )
+            if (bSuccess && nAspect != embed::Aspects::MSOLE_ICON)
             {
                 //  Math objects change their object size during InsertObject.
                 //  New size must be set in SdrObject, or a wrong scale will be set at
@@ -380,7 +380,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
                     // Object selected, activate Draw-Shell
                     rViewShell.SetDrawShell( true );
                 }
-                else
+                else if (bSuccess)
                 {
                     rViewShell.ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW);
                 }


More information about the Libreoffice-commits mailing list