diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-28 21:51:01 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-06-26 16:42:14 +0200 |
commit | dbd8adf30c810558924929647fc5caea718e9635 (patch) | |
tree | b514aed853242a02413b6e655606ebb294b826fc | |
parent | 47f090e2e4ba84684cdd1c0684cb1b9f2baa600f (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)
-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 e3a622b81f45..adb2d0e7af72 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -542,7 +542,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; } |