Skip to content

Conversation

luanlongshengv
Copy link

This PR addresses an issue in the SpiralIterator::operator++() function where the pop_back() method was called on an empty pointsRing_ container, leading to undefined behavior. The fix involves adding a check to ensure that pointsRing_ is not empty before attempting to call pop_back(). This change prevents potential crashes and ensures the iterator operates correctly even when the container is empty.
This change ensures the iterator’s robustness and prevents potential runtime errors.

@Ryanf55 Ryanf55 added the ros1 Affects ROS 1 label Nov 8, 2024
Copy link
Collaborator

@Ryanf55 Ryanf55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ryanf55 Ryanf55 added the bug label Nov 8, 2024
@Ryanf55
Copy link
Collaborator

Ryanf55 commented Nov 8, 2024

@maximilianwulf Please merge this fix

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Nov 28, 2024

This has been merged into all of the maintained ROS 2 branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ros1 Affects ROS 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants