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

Caolán McNamara caolanm at redhat.com
Sun Jun 17 18:34:01 UTC 2018


 basic/source/comp/scanner.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 65169f6b9e894ec5cdd073ef214fbcbbdd8e4e7d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jun 17 16:19:27 2018 +0100

    crashtesting: check nLineIdx
    
    Change-Id: If499712955702e760524478711160194ecea47c0
    Reviewed-on: https://gerrit.libreoffice.org/55954
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index bbe02978bb14..2365d3aeb112 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -495,7 +495,7 @@ bool SbiScanner::NextSym()
     }
 
     // Strings:
-    else if (aLine[nLineIdx] == '"' || aLine[nLineIdx] == '[')
+    else if (nLineIdx < aLine.getLength() && (aLine[nLineIdx] == '"' || aLine[nLineIdx] == '['))
     {
         sal_Unicode cSep = aLine[nLineIdx];
         if( cSep == '[' )
@@ -545,7 +545,7 @@ bool SbiScanner::NextSym()
     }
 
     // Date:
-    else if (aLine[nLineIdx] == '#')
+    else if (nLineIdx < aLine.getLength() && aLine[nLineIdx] == '#')
     {
         sal_Int32 n = nCol + 1;
         do
@@ -592,7 +592,7 @@ bool SbiScanner::NextSym()
         }
     }
     // invalid characters:
-    else if (aLine[nLineIdx] >= 0x7F)
+    else if (nLineIdx < aLine.getLength() && aLine[nLineIdx] >= 0x7F)
     {
         GenError( ERRCODE_BASIC_SYNTAX ); nLineIdx++; nCol++;
     }


More information about the Libreoffice-commits mailing list