diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-28 21:51:01 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-10 16:33:43 +0200 |
commit | 17696b9be64318c24ae680bbf99be150a66b1c5e (patch) | |
tree | 4fd5ba3c939f5b12f9b5857df0ab4223214ea511 /basic | |
parent | 69bbc34bfce946622dbbf73c2d0cf647c570e0d0 (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.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 4cd7928b3a02..a39bd779ed7e 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -547,7 +547,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; } |