summaryrefslogtreecommitdiff
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-27 12:37:28 +0200
commit9d00f5034eef7867d8973a9d7b124e531bfccd7d (patch)
tree607ac263ac6376d3c6ae332cc37c6b2c0da8ac05
parent3547cd460263f710d2f49fbb8bf00808c012629e (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) (cherry picked from commit dbd8adf30c810558924929647fc5caea718e9635)
-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 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;
}