summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-28 21:51:01 +0100
committerAndras Timar <andras.timar@collabora.com>2018-06-01 20:46:27 +0200
commit6c7615023eedd8a574e3a051bc2e4768900a24c5 (patch)
treef3156cdcf6b6b06f7978b8b0d8dba6e239541c8b /basic
parent166fb85a421cc0de1331b5ba3f4e2a89bf631a07 (diff)
forcepoint#42 check available str length
Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975 Reviewed-on: https://gerrit.libreoffice.org/54978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 15ea1cda0b3c37ff944ad9a239b7ed453e8b0591)
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/scanner.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 67177b7d9f44..89f4140a7a60 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -607,7 +607,7 @@ bool SbiScanner::NextSym()
case '>': if( *pLine == '=' ) n = 2; break;
case ':': if( *pLine == '=' ) n = 2; break;
}
- aSym = aLine.copy( nCol, n );
+ aSym = aLine.copy(nCol, std::min(n, aLine.getLength() - nCol));
pLine += n-1; nCol = nCol + n;
}