Skip to content

DCMathSegmentMaker: Resolve a segfault in MCSFT::find3DSegments

Stephen Nicholas Swatman requested to merge sswatman/athena:bugfix-002 into master

The existing code incorrectly removes elements from a std::vector while iterating over it. While it is possible to safely remove elements from a vector it is unintuitive and error-prone. The old code caused segmentation faults by iterating out of the vector's allocated memory. In addition, it fails to achieve its goal of clearing the vector completely. We resolve this bug by using the std::vector::clear method which is safer and easier to understand.

Merge request reports