writerfilter/source/rtftok/rtfdocumentimpl.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit fcae5e4103bb16bd44a48c2b63dcbafa9b438a9e Author: Miklos Vajna <vmik...@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)); _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits