sw/source/filter/ascii/ascatr.cxx | 8 ++++++-- xmloff/source/text/txtparae.cxx | 9 +++++---- 2 files changed, 11 insertions(+), 6 deletions(-)
New commits: commit ef3e481be37a387f6549a561daee890da6712cf5 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Jun 19 17:54:27 2014 +0200 Do not call SwASC_AttrIter::NextPos when nAktSwPos is already SAL_MAX_INT32 ...and calculating nAktSwPos + 1 would overflow. Reported by CppunitTest_sw_odfexport under -sanitize=undefined. Change-Id: I78bd540851192a768400ce348b42228f9cb10b72 diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 1fb879f..04a5d89 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -197,7 +197,7 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) const bool bExportSoftHyphens = RTL_TEXTENCODING_UCS2 == rWrt.GetAsciiOptions().GetCharSet() || RTL_TEXTENCODING_UTF8 == rWrt.GetAsciiOptions().GetCharSet(); - do { + for (;;) { const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd); if( !aAttrIter.OutAttr( nStrPos )) @@ -209,8 +209,12 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) rWrt.Strm().WriteUnicodeOrByteText( aOutStr ); } nStrPos = nNextAttr; + if (nStrPos >= nEnd) + { + break; + } aAttrIter.NextPos(); - } while( nStrPos < nEnd ); + } if( !bLastNd || ( ( !rWrt.bWriteClipboardDoc && !rWrt.bASCII_NoLastLineEnd ) commit d8e7624c9a874aee3ab782715117b118ddd0c496 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Jun 19 17:51:36 2014 +0200 Do not dereference null pointer ...and XMLTextCharStyleNamesElementExport only requires a non-null rPropSet arg when its bDoSomething arg is true. Reported by CppunitTest_sw_odfexport under -sanitize=undefined. Change-Id: Ia45fa7db250f83d746829c7f411e78bbc50bf721 diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 7c91085..108fe8e 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2843,11 +2843,12 @@ void XMLTextParagraphExport::exportAnyTextFrame( else bIsUICharStyle = false; + bool bDoSomething = bIsUICharStyle + && aCharStyleNamesPropInfoCache.hasProperty( *pRangePropSet ); XMLTextCharStyleNamesElementExport aCharStylesExport( - GetExport(), bIsUICharStyle && - aCharStyleNamesPropInfoCache.hasProperty( - *pRangePropSet ), bHasAutoStyle, - *pRangePropSet, sCharStyleNames ); + GetExport(), bDoSomething, bHasAutoStyle, + bDoSomething ? *pRangePropSet : Reference<XPropertySet>(), + sCharStyleNames ); if( !sStyle.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits