Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty check and iterator validation in ContainerIterator::advance() #2894

Closed
wants to merge 1 commit into from

Conversation

dudantas
Copy link
Contributor

@dudantas dudantas commented Sep 16, 2024

Description:
This PR adds an !over.empty() check in ContainerIterator::advance() to ensure the iterator does not access an empty queue or go out of bounds during container iteration.

Key Changes:

Added validation to prevent accessing over.front() when the over queue is empty.
Ensured the iterator cur is correctly repositioned to the next container, preventing out-of-bounds access to itemlist.
This improves the stability and prevents potential crashes during container iteration.

@dudantas dudantas force-pushed the dudantas/fix-crash-on-container-advance branch from 0391d76 to 003da9f Compare September 16, 2024 02:51
…vance()

Description:
This PR adds an !over.empty() check in ContainerIterator::advance() to ensure the iterator does not access an empty queue or go out of bounds during container iteration.

Key Changes:

Added validation to prevent accessing over.front() when the over queue is empty.
Ensured the iterator cur is correctly repositioned to the next container, preventing out-of-bounds access to itemlist.
This improves the stability and prevents potential crashes during container iteration.
@dudantas dudantas force-pushed the dudantas/fix-crash-on-container-advance branch from 6ccab61 to 61b5701 Compare September 16, 2024 04:57
@dudantas dudantas changed the title fix: crash on container advance fix: add empty check and iterator validation in ContainerIterator::advance() Sep 16, 2024
@dudantas dudantas changed the title fix: add empty check and iterator validation in ContainerIterator::advance() fix: empty check and iterator validation in ContainerIterator::advance() Sep 16, 2024
@dudantas
Copy link
Contributor Author

Closing in favor of: #2901

@dudantas dudantas closed this Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants