diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-03 19:42:07 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-03 19:42:07 +0200 |
commit | 531898caeabd158804d252cd296fb25e93f64a55 (patch) | |
tree | 5f6210cc8099f4bc5139bd1f5c475a8bf509325f | |
parent | 277e4532e9d7b8a6ca64a5d265665ed974464505 (diff) |
fixes for CVE-2007-0245-1.rtf
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 36f7723a3..152c3d540 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2175,12 +2175,14 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) m_aFormfieldSprms->push_back(make_pair(NS_ooxml::LN_CT_FFDDList_result, pIntValue)); break; case RTF_EDMINS: - m_xDocumentProperties->setEditingDuration(nParam); + if (m_xDocumentProperties.is()) + m_xDocumentProperties->setEditingDuration(nParam); break; case RTF_NOFPAGES: case RTF_NOFWORDS: case RTF_NOFCHARS: case RTF_NOFCHARSWS: + if (m_xDocumentProperties.is()) { uno::Sequence<beans::NamedValue> aSet = m_xDocumentProperties->getDocumentStatistics(); OUString aName; @@ -2210,7 +2212,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) } break; case RTF_VERSION: - m_xDocumentProperties->setEditingCycles(nParam); + if (m_xDocumentProperties.is()) + m_xDocumentProperties->setEditingCycles(nParam); break; case RTF_VERN: // Ignore this for now, later the RTF writer version could be used to add hacks for older buggy writers. @@ -2645,9 +2648,12 @@ int RTFDocumentImpl::popState() { OUString aName = m_aStates.top().nDestinationState == DESTINATION_OPERATOR ? OUString(RTL_CONSTASCII_USTRINGPARAM("Operator")) : OUString(RTL_CONSTASCII_USTRINGPARAM("Company")); - uno::Reference<beans::XPropertyContainer> xUserDefinedProperties = m_xDocumentProperties->getUserDefinedProperties(); - xUserDefinedProperties->addProperty(aName, beans::PropertyAttribute::REMOVEABLE, - uno::makeAny(m_aDestinationText.makeStringAndClear())); + if (m_xDocumentProperties.is()) + { + uno::Reference<beans::XPropertyContainer> xUserDefinedProperties = m_xDocumentProperties->getUserDefinedProperties(); + xUserDefinedProperties->addProperty(aName, beans::PropertyAttribute::REMOVEABLE, + uno::makeAny(m_aDestinationText.makeStringAndClear())); + } } else if (m_aStates.top().nDestinationState == DESTINATION_OBJDATA) { |