diff options
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++; } |