diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-10-16 13:13:29 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-10-16 13:28:14 +0200 |
commit | 0c44f702a04db0fffd6884dcb014b28cdff5b21c (patch) | |
tree | cada90e56887c4d4f93c529011b46ba9dbe30ed4 /i18npool/source | |
parent | 228a0a80250aecd4be60e32a42a52901130a04e6 (diff) |
tdf#96197 i18npool: don't read beyond end of string
Asserts on loading ooo100660-1.odg.
(regression from 441fded7f7fc8a2564075406933226a6eea73dd1)
Change-Id: I6821490e4ca6100da173ed19329a808867d2193d
Diffstat (limited to 'i18npool/source')
-rw-r--r-- | i18npool/source/breakiterator/breakiterator_cjk.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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; |