diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-06-17 16:19:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-06-17 20:33:42 +0200 |
commit | 65169f6b9e894ec5cdd073ef214fbcbbdd8e4e7d (patch) | |
tree | 2350009bd6fb3e833612127e2555f9e4fb36031e /basic | |
parent | dab606b93fee4a3aac895e4f3b4a5bc375140885 (diff) |
crashtesting: check nLineIdx
Change-Id: If499712955702e760524478711160194ecea47c0
Reviewed-on: https://gerrit.libreoffice.org/55954
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/scanner.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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++; } |