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

Stephan Bergmann sbergman at redhat.com
Fri Aug 28 00:27:05 PDT 2015


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 43cb629de1ecc41f702f14209ba8199dfe57c3a2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Aug 28 09:26:41 2015 +0200

    Make sure nEnd-nIndex-1 is valid arg to OUString::copy
    
    Change-Id: Ie646ae781bcd54be81173db42fe10f61b31ac628

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b47d870..2a8621a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2974,7 +2974,7 @@ void  DomainMapper_Impl::handleRubyEQField( FieldContextPtr pContext)
         nIndex = 0;
         OUString sPart1 = sRubyParts.getToken(0, ',', nIndex);
         OUString sPart2 = sRubyParts.getToken(0, ',', nIndex);
-        if ((nIndex = sPart1.indexOf('(')) != -1 && (nEnd = sPart1.lastIndexOf(')'))!=-1 )
+        if ((nIndex = sPart1.indexOf('(')) != -1 && (nEnd = sPart1.lastIndexOf(')'))!=-1  && nEnd > nIndex)
         {
             aInfo.sRubyText = sPart1.copy(nIndex+1,nEnd-nIndex-1);
         }


More information about the Libreoffice-commits mailing list