summaryrefslogtreecommitdiff
path: root/basic/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-28 21:51:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-29 10:09:14 +0200
commitf2d5ba04a7660ecea326d90d08ec8002462883a5 (patch)
treefef838631b5c84bf7b72d02d2908a9dd5b5f38f2 /basic/source
parentf532decefb7881eb5f56864db9fcfd5d2ba85ee4 (diff)
forcepoint#42 check available str length
Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975 Reviewed-on: https://gerrit.libreoffice.org/54977 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic/source')
-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 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;
}