diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-28 21:51:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-29 10:04:17 +0200 |
commit | a2dae039f1209b5324879930c142b24d50fafc69 (patch) | |
tree | 1835e81eec0f576f2efeb5acdf0608b87989fe39 /basic | |
parent | be1c4cfa195ac8a34c543b85dd17ceb75204fff9 (diff) |
forcepoint#42 check available str length
Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975
Reviewed-on: https://gerrit.libreoffice.org/54976
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
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 f29b5c2a5d9f..e79f145c29b9 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -606,7 +606,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; } |