summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2011-08-03 19:46:26 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2011-08-03 19:47:22 +0200
commitdd0723ff74d79615862e3066b07cbb0f48b20f2a (patch)
tree6730dd860fe013e96c79fe0f12b545548462aa82
parent531898caeabd158804d252cd296fb25e93f64a55 (diff)
fixes for CVE-2010-3333-1.rtf
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index dde66d51c..f83280ded 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -73,7 +73,8 @@ RTFSdrImport::~RTFSdrImport()
void RTFSdrImport::createShape(OUString aStr, uno::Reference<drawing::XShape>& xShape, uno::Reference<beans::XPropertySet>& xPropertySet)
{
- xShape.set(m_rImport.getModelFactory()->createInstance(aStr), uno::UNO_QUERY);
+ if (m_rImport.getModelFactory().is())
+ xShape.set(m_rImport.getModelFactory()->createInstance(aStr), uno::UNO_QUERY);
xPropertySet.set(xShape, uno::UNO_QUERY);
}
@@ -279,7 +280,8 @@ void RTFSdrImport::resolve(RTFShape& rShape)
return;
}
- m_xDrawPage->add(xShape);
+ if (m_xDrawPage.is())
+ m_xDrawPage->add(xShape);
if (bCustom)
{
uno::Reference<drawing::XEnhancedCustomShapeDefaulter> xDefaulter(xShape, uno::UNO_QUERY);
@@ -314,8 +316,11 @@ void RTFSdrImport::resolve(RTFShape& rShape)
xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CustomShapeGeometry")), uno::Any(aGeomPropSeq));
// Set position and size
- xShape->setPosition(awt::Point(rShape.nLeft, rShape.nTop));
- xShape->setSize(awt::Size(rShape.nRight - rShape.nLeft, rShape.nBottom - rShape.nTop));
+ if (xShape.is())
+ {
+ xShape->setPosition(awt::Point(rShape.nLeft, rShape.nTop));
+ xShape->setSize(awt::Size(rShape.nRight - rShape.nLeft, rShape.nBottom - rShape.nTop));
+ }
// Send it to dmapper
m_rImport.Mapper().startShape(xShape);