GDCM icon indicating copy to clipboard operation
GDCM copied to clipboard

Iterator invalidation bug

Open percontation opened this issue 1 year ago • 0 comments

This DS.Remove() invalidates the iterator it because it deletes the current element of the std::set within DS.

This is a use-after-free, that in rare circumstances can lead to memory corruption (but in practice, for single-threaded programs, has possibly never actually caused any issues).

The removal is extraneous anyways, due to the subsequent DS = copy.

percontation avatar Aug 01 '24 16:08 percontation