Fix the potential application crash issues#426
Merged
clalancette merged 4 commits intoros2:masterfrom Dec 19, 2017
Merged
Conversation
dirk-thomas
reviewed
Dec 19, 2017
rclcpp/src/rclcpp/publisher.cpp
Outdated
| auto intra_process_topic_name = std::string(this->get_topic_name()) + "/_intra"; | ||
| const char * topic_name = this->get_topic_name(); | ||
| if (topic_name) { | ||
| auto intra_process_topic_name = std::string(topic_name) + "/_intra"; |
Member
There was a problem hiding this comment.
Have you tried to compile the patch locally (and ran the tests)? It look to me that the variable has a local scope and therefore isn't available below where it is being used.
Contributor
Author
There was a problem hiding this comment.
badly, it becomes a local scope within if{}, and I changed it. Now all have passed the build and tests, thanks !
dirk-thomas
reviewed
Dec 19, 2017
| intra_process_topic_name = std::string(topic_name) + "/_intra"; | ||
| } else { | ||
| throw std::runtime_error("Get a invalid null topic name"); | ||
| } |
Member
There was a problem hiding this comment.
Please use a similar structure here as above. Check for !topic_name and conditionally throw, Then the else case becomes obsolete.
Contributor
Author
There was a problem hiding this comment.
make sense, changed 😄
Member
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
clalancette
approved these changes
Dec 19, 2017
Contributor
|
Builds are all green, @dirk-thomas thinks it is OK, looks OK to me. Merging. |
nnmm
pushed a commit
to ApexAI/rclcpp
that referenced
this pull request
Jul 9, 2022
This way we avoid tripping a Fast-CDR check for a 0 or 1 in the bool field. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
DensoADAS
pushed a commit
to DensoADAS/rclcpp
that referenced
this pull request
Aug 5, 2022
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_topic_nameandrcl_service_get_service_namemay return NULLSigned-off-by: Ethan Gao ethan.gao@linux.intel.com