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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 13 12:22:13 UTC 2018


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

New commits:
commit 374c88d97429721414841f556b5885f497491b82
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Oct 12 19:57:17 2018 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Nov 13 13:21:48 2018 +0100

    do not crash in opencl code with malformed formula
    
    Change-Id: Ie749b57eb0041059ad91a6ec66eddb631168cd56
    Reviewed-on: https://gerrit.libreoffice.org/63180
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 9cc9df1724e0..a0c7a098c579 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3600,6 +3600,8 @@ DynamicKernel* DynamicKernel::create( const ScCalcConfig& rConfig, const ScToken
             sal_uInt8 nParamCount =  pCur->GetParamCount();
             for (sal_uInt8 i = 0; i < nParamCount; i++)
             {
+                if( aTokenVector.empty())
+                    return nullptr;
                 FormulaToken* pTempFormula = aTokenVector.back();
                 aTokenVector.pop_back();
                 if (pTempFormula->GetOpCode() != ocPush)


More information about the Libreoffice-commits mailing list