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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 10 13:00:07 UTC 2020


 basic/source/runtime/runtime.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit b55f56ca0417105f1e10131503d5560fb6c7e452
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 10 11:37:50 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jul 10 14:59:43 2020 +0200

    tdf#134576 at least don't crash in this edge-case
    
    Change-Id: I69638fd2130c1ba68915906ced62bda2cd883932
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98491
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 607604f8abd6..9424482da487 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -2597,10 +2597,14 @@ void SbiRuntime::StepNEXT()
         StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
         return;
     }
-    if( pForStk->eForType == ForType::To )
+    if (pForStk->eForType != ForType::To)
+        return;
+    if (!pForStk->refVar)
     {
-        pForStk->refVar->Compute( SbxPLUS, *pForStk->refInc );
+        StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
+        return;
     }
+    pForStk->refVar->Compute( SbxPLUS, *pForStk->refInc );
 }
 
 // beginning CASE: TOS in CASE-stack


More information about the Libreoffice-commits mailing list