diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2014-05-17 19:40:02 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2014-05-17 19:41:52 +0200 |
commit | f7e2f18e897198c5ee79d9825ac3b3ecbd2bd398 (patch) | |
tree | 5101d212e1bf00a889b31d80db9a318e00c209dd /vcl | |
parent | fcf4b4c3ebc46de974d57bdf6211ccb084b0835d (diff) |
avoid segfault when nBrekPos is past the end
Change-Id: Ieedc24c0443ba10d8277cd6327b3b735203e5d45
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 5 |
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 |