From d328afa3441c99f8be85adbb78099c198e8d35ec Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 14 May 2016 10:01:34 +0100 Subject: crashtesting: Error: attempt to increment a singular iterator revert commit 96fab0513215cc416e96e1b2089466afd0d2791c Author: Noel Grandin Date: Thu May 12 10:07:50 2016 +0200 clang-tidy modernize-loop-convert in writerfilter to xmlsecurity for OOXMLPropertySet::resolve which modifies the mProperties it iterates over e.g. fdo67086-1.docx, fdo72640-6.docx etc Change-Id: I14f829d1425d56110c0aa8d42e751bd2f1d3dd2a --- writerfilter/source/ooxml/OOXMLPropertySet.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx b/writerfilter/source/ooxml/OOXMLPropertySet.cxx index 73dd505ffdb3..81e52ace7594 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx @@ -354,8 +354,10 @@ void OOXMLPropertySet::resolve(Properties & rHandler) // 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. - for (OOXMLProperty::Pointer_t& pProp : mProperties) + for (size_t nIt = 0; nIt < mProperties.size(); ++nIt) { + OOXMLProperty::Pointer_t pProp = mProperties[nIt]; + if (pProp.get() != nullptr) pProp->resolve(rHandler); } -- cgit