summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-28 21:51:01 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-08-02 14:08:20 +0200
commit53a483d08a71f2bff6d349eac66b636cb45af40d (patch)
tree5ce55290df74aaaecbcbb114fd7f0606985ae6ce
parentforcepoint#41 null deref (diff)
downloadcore-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.cxx2
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;
}