[Libreoffice-commits] .: writerfilter/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Sun Nov 20 16:23:14 PST 2011


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit fcae5e4103bb16bd44a48c2b63dcbafa9b438a9e
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Mon Nov 21 01:24:07 2011 +0100

    Related: i#86517 avoid crash on invalid LEVELTEXT

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index ffc3846..3b79937 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2794,7 +2794,11 @@ int RTFDocumentImpl::popState()
 
         // The first character is the length of the string (the rest should be ignored).
         sal_Int32 nLength(aStr.toChar());
-        OUString aValue = aStr.copy(1, nLength);
+        OUString aValue;
+        if (nLength <= aStr.getLength())
+            aValue = aStr.copy(1, nLength);
+        else
+            aValue = aStr;
         RTFValue::Pointer_t pValue(new RTFValue(aValue, true));
         m_aStates.top().aTableAttributes->push_back(make_pair(NS_ooxml::LN_CT_LevelText_val, pValue));
 


More information about the Libreoffice-commits mailing list