diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-28 21:51:01 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-08-02 14:08:20 +0200 |
commit | 53a483d08a71f2bff6d349eac66b636cb45af40d (patch) | |
tree | 5ce55290df74aaaecbcbb114fd7f0606985ae6ce | |
parent | forcepoint#41 null deref (diff) | |
download | core-53a483d08a71f2bff6d349eac66b636cb45af40d.tar.gz core-53a483d08a71f2bff6d349eac66b636cb45af40d.zip |
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 6dfe2c589bbf..784122d6d7c1 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -543,7 +543,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; } |