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 possible nullptr access in robot_joint.cpp. #636

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

clalancette
Copy link
Contributor

As pointed out by clang static analysis, the checks here
are not sufficient to prevent a nullptr access in the
unlikely case that a link is nullptr. Revamp the code
so that we get out early if a link is nullptr.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

As pointed out by clang static analysis, the checks here
are not sufficient to prevent a nullptr access in the
unlikely case that a link is nullptr.  Revamp the code
so that we get out early if a link is nullptr.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Copy link
Contributor

@mjeronimo mjeronimo left a comment

Choose a reason for hiding this comment

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

Unrelated to the present code change: seems like a lot of duplication among the two updated functions. Perhaps an opportunity to refactor (on a subsequent PR) to remove the duplication.

@clalancette
Copy link
Contributor Author

clalancette commented Dec 17, 2020

Unrelated to the present code change: seems like a lot of duplication among the two updated functions. Perhaps an opportunity to refactor (on a subsequent PR) to remove the duplication.

Good point. I'll open up an issue to follow-up on this.

Also, here is CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor Author

CI is green, so merging. Thanks for the review!

@clalancette clalancette merged commit e720e16 into ros2 Dec 17, 2020
@clalancette clalancette deleted the clalancette/fix-possible-nullptr-access branch December 17, 2020 21:58
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.

None yet

2 participants