summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-03-12 15:19:14 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-03-12 15:30:09 +0200
commitb68f06287d34833a59841b8000641a02d0994eb8 (patch)
treed1cee3d963f29de07724c0218e749ea3bf488187 /writerfilter
parent61eeb689d7605a23c3e71c652b57ee65cf5b28dc (diff)
Fix crash with document from bnc#693238
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index 505f5c326816..b0a0c5d90aad 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -424,10 +424,15 @@ OOXMLPropertySetImpl::~OOXMLPropertySetImpl()
void OOXMLPropertySetImpl::resolve(Properties & rHandler)
{
- OOXMLProperties_t::iterator aIt = begin();
- while (aIt != end())
+ size_t nIt = 0;
+
+ // The pProp->resolve(rHandler) call below can cause elements to
+ // be appended to mProperties. I don't think it can cause elements
+ // to be deleted. But let's check with < here just to be safe that
+ // the indexing below works.
+ while (nIt < mProperties.size())
{
- OOXMLProperty::Pointer_t pProp = *aIt;
+ OOXMLProperty::Pointer_t pProp = mProperties[nIt];
if (pProp.get() != NULL)
pProp->resolve(rHandler);
@@ -440,7 +445,7 @@ void OOXMLPropertySetImpl::resolve(Properties & rHandler)
}
#endif
- ++aIt;
+ ++nIt;
}
}