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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 18 13:36:26 UTC 2019


 sc/source/core/tool/compiler.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c2cb3af28a415c2e68b8fe18465522636cb7f774
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Nov 18 10:00:11 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Nov 18 14:35:17 2019 +0100

    cid#1448537 silence Wrapper object use after free
    
    Change-Id: I896556485c441c9d0e79e75f41d0eb452f0eb21f
    Reviewed-on: https://gerrit.libreoffice.org/83069
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    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/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index ac0390d4ee56..d750f377d1ad 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4739,6 +4739,7 @@ std::unique_ptr<ScTokenArray> ScCompiler::CompileString( const OUString& rFormul
     // remember pArr, in case a subsequent CompileTokenArray() is executed.
     std::unique_ptr<ScTokenArray> pNew(new ScTokenArray( aArr ));
     pNew->GenHash();
+    // coverity[escape : FALSE] - ownership of pNew is retained by caller, so pArr remains valid
     pArr = pNew.get();
     maArrIterator = FormulaTokenArrayPlainIterator(*pArr);
 
@@ -4770,6 +4771,7 @@ std::unique_ptr<ScTokenArray> ScCompiler::CompileString( const OUString& rFormul
         {
             // remember pArr, in case a subsequent CompileTokenArray() is executed.
             std::unique_ptr<ScTokenArray> pNew(new ScTokenArray( aTokenArray ));
+            // coverity[escape : FALSE] - ownership of pNew is retained by caller, so pArr remains valid
             pArr = pNew.get();
             maArrIterator = FormulaTokenArrayPlainIterator(*pArr);
             return pNew;


More information about the Libreoffice-commits mailing list