summaryrefslogtreecommitdiff
path: root/vcl/source/edit
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-05-17 19:40:02 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2014-05-17 19:41:52 +0200
commitf7e2f18e897198c5ee79d9825ac3b3ecbd2bd398 (patch)
tree5101d212e1bf00a889b31d80db9a318e00c209dd /vcl/source/edit
parentfcf4b4c3ebc46de974d57bdf6211ccb084b0835d (diff)
avoid segfault when nBrekPos is past the end
Change-Id: Ieedc24c0443ba10d8277cd6327b3b735203e5d45
Diffstat (limited to 'vcl/source/edit')
-rw-r--r--vcl/source/edit/texteng.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 2223ff092e18..b114adeb62be 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1708,8 +1708,9 @@ void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*,
pLine->SetEnd( nBreakPos );
sal_uInt16 nEndPortion = SplitTextPortion( nPara, nBreakPos );
- bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) &&
- ( pNode->GetText()[ nBreakPos ] == ' ' ) );
+ bool bBlankSeparator = ( nBreakPos >= pLine->GetStart() &&
+ nBreakPos < pNode->GetText().getLength() &&
+ pNode->GetText()[ nBreakPos ] == ' ' );
if ( bBlankSeparator )
{
// generally suppress blanks at the end of line