[Libreoffice-commits] core.git: i18npool/source

Michael Stahl mstahl at redhat.com
Mon Oct 16 11:30:03 UTC 2017


 i18npool/source/breakiterator/breakiterator_cjk.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0c44f702a04db0fffd6884dcb014b28cdff5b21c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Oct 16 13:13:29 2017 +0200

    tdf#96197 i18npool: don't read beyond end of string
    
    Asserts on loading ooo100660-1.odg.
    
    (regression from 441fded7f7fc8a2564075406933226a6eea73dd1)
    
    Change-Id: I6821490e4ca6100da173ed19329a808867d2193d

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;


More information about the Libreoffice-commits mailing list