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 segfault due to invalid iterator #251

Merged
merged 2 commits into from
Jul 17, 2023
Merged

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Jul 14, 2023

Public-Facing Changes

Fix segfault due to invalid iterator

Description

Fixes a segfault caused by using an invalid iterator as argument to std::unordered_map<...>::erase. This regression was introduced in #250.

@achim-k achim-k requested a review from jtbandes July 14, 2023 19:01
Copy link
Member

@jtbandes jtbandes left a comment

Choose a reason for hiding this comment

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

Can we add a test for this easily?

@achim-k
Copy link
Collaborator Author

achim-k commented Jul 14, 2023

Can we add a test for this easily?

Yes! Will do, noticed that we currently do not test the unsubscribe operation.

Update: Adapted tests to use the unsubscribe operation. Trigger a segfault without 20d9d2e

achim-k added a commit to foxglove/ws-protocol that referenced this pull request Jul 14, 2023
achim-k added a commit to foxglove/ws-protocol that referenced this pull request Jul 17, 2023
### Public-Facing Changes

C++ implementation: Fix segfault due to invalid iterator

### Description
See foxglove/ros-foxglove-bridge#251
@achim-k achim-k merged commit d992017 into main Jul 17, 2023
10 checks passed
@achim-k achim-k deleted the achim/fix-wrong-iterator-erase branch July 17, 2023 13:05
pezy pushed a commit to pezy/ws-protocol that referenced this pull request Jul 27, 2023
### Public-Facing Changes

C++ implementation: Fix segfault due to invalid iterator

### Description
See foxglove/ros-foxglove-bridge#251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants