From 0c44f702a04db0fffd6884dcb014b28cdff5b21c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 16 Oct 2017 13:13:29 +0200 Subject: tdf#96197 i18npool: don't read beyond end of string Asserts on loading ooo100660-1.odg. (regression from 441fded7f7fc8a2564075406933226a6eea73dd1) Change-Id: I6821490e4ca6100da173ed19329a808867d2193d --- i18npool/source/breakiterator/breakiterator_cjk.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'i18npool') diff --git a/i18npool/source/breakiterator/breakiterator_cjk.cxx b/i18npool/source/breakiterator/breakiterator_cjk.cxx index de33d122276a..5367b975e10c 100644 --- a/i18npool/source/breakiterator/breakiterator_cjk.cxx +++ b/i18npool/source/breakiterator/breakiterator_cjk.cxx @@ -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; -- cgit