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

Caolán McNamara caolanm at redhat.com
Wed Nov 6 10:12:56 CET 2013


 i18npool/source/breakiterator/breakiteratorImpl.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 16c31e90f791c5a690ca1901c0fa40369023658b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 5 16:47:40 2013 +0000

    don't access string out of bounds
    
    Change-Id: I562fbdb9eec3af297ea95a0d161721ec345e6a19

diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 4235027..f969e7f 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -347,7 +347,7 @@ sal_Int32 SAL_CALL BreakIteratorImpl::nextScript( const OUString& Text, sal_Int3
     if (nStartPos < 0)
         nStartPos = 0;
     sal_Int32 strLen = Text.getLength();
-    if (nStartPos > strLen)
+    if (nStartPos >= strLen)
         return -1;
 
     sal_Int16 numberOfChange = (ScriptType == getScriptClass(Text.iterateCodePoints(&nStartPos, 0))) ? 2 : 1;


More information about the Libreoffice-commits mailing list