PointSet::SetPoints(PointsVectorContainer *)
overload leads to undefined behavior
#4848
Labels
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Description
PointSet::SetPoints(PointsVectorContainer * points)
internally casts its argument to aPointsContainer *
:ITK/Modules/Core/Common/include/itkPointSet.hxx
Line 76 in 9a5dade
This leads to undefined behavior, when the
PointsVectorContainer
object is being used as aPointsContainer
object.Steps to Reproduce
The test code already has undefined behavior, even if it might just work on the currently tested platforms:
ITK/Modules/Core/Common/test/itkPointSetTest.cxx
Lines 102 to 127 in 9a5dade
Versions
PointSet::SetPoints(PointsVectorContainer *)
overload is introduced by pull request ENH: Support for Mesh serialization #3154 commit 6827360 "ENH: Adding SetPoints in PointSet for 1D input array", merged on Mar 16, 2022, and included with both v5.3.0 and v5.4.0.Additional Information
Discussed before at #3154 (comment), with @PranjalSahu
The text was updated successfully, but these errors were encountered: