Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing
|Summary:||sfx2: usage of invalidated iterator|
|Status:||CLOSED FIXED||QA Contact:||issues@framework <issues>|
|Target Milestone:||OOo 3.0.1|
|Issue Type:||PATCH||Latest Confirmation in:||---|
Description dtardon 2008-09-12 08:18:59 UTC
There is a for loop in SfxDocumentMetaData::setMetaList() which goes through a vector in reverse (using it's reverse_iterator) and removes all it's elements from it (by means of pop_back) and from another structure. But, AFAIK, pop_back() invalidates iterators pointing to popped element; thus, the loop iterator's base() is invalidated and so is the iterator itself.
Comment 1 dtardon 2008-09-12 08:24:03 UTC
Created attachment 56458 [details] Splits the removal into two steps: 1. remove items from m_xParent 2. clean vec .
Comment 2 mst.ooo 2008-09-15 11:39:10 UTC
hi dtardon, i've applied your patch in cws fwk94. though according to the notes on http://www.sgi.com/tech/stl/Vector.html it shouldn't be necessary; but maybe the c++ standard differs from the sgi documentation, so better be on the safe side...
Comment 3 mst.ooo 2008-09-15 11:42:57 UTC
oh, forgot to grab the issue...
Comment 4 mst.ooo 2008-10-06 11:47:54 UTC
Comment 5 caolanm 2008-11-27 17:25:24 UTC