tdf#96197 i18npool: don't read beyond end of string

Asserts on loading ooo100660-1.odg.

(regression from 441fded7f7)

Change-Id: I6821490e4ca6100da173ed19329a808867d2193d
This commit is contained in:
Michael Stahl 2017-10-16 13:13:29 +02:00
parent 228a0a8025
commit 0c44f702a0

View file

@ -116,7 +116,8 @@ LineBreakResults SAL_CALL BreakIterator_CJK::getLineBreak(
}
// Prevent cutting Korean words in the middle.
if ( nOldStartPos == nStartPos && isHangul( Text[nStartPos] ) )
if (nOldStartPos == nStartPos && nStartPos < Text.getLength()
&& isHangul(Text[nStartPos]))
{
while ( nStartPos >= 0 && isHangul( Text[nStartPos] ) )
--nStartPos;