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 bug in create where command line arguments were truncated #472

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Dec 19, 2023

🦟 Bug fix

Summary

Arguments were being truncated because the size argument of sprintf was sizeof(filtered_argv), which is the size of a pointer (e.g 8).

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

ups

/github/home/ws/src/ros_gz/ros_gz_sim/src/create.cpp:63:  Almost always, snprintf is better than strcpy  [runtime/printf] [4]

Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
@azeey azeey marked this pull request as ready for review December 20, 2023 21:17
@azeey
Copy link
Contributor Author

azeey commented Dec 20, 2023

ups

/github/home/ws/src/ros_gz/ros_gz_sim/src/create.cpp:63:  Almost always, snprintf is better than strcpy  [runtime/printf] [4]

Okay, changed it back to snprintf. Also added a test. I haven't used launch_testing before, so let me know if I'm not using it correctly.

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

linters are failing

2023-12-20T21:27:06.0815611Z The following tests FAILED:
2023-12-20T21:27:06.0817056Z 	  5 - cpplint (Failed)
2023-12-20T21:27:06.0819323Z 	  6 - flake8 (Failed)
2023-12-20T21:27:06.0821402Z 	  9 - uncrustify (Failed)

Signed-off-by: Addisu Z. Taddese <[email protected]>
@azeey azeey requested a review from ahcorde December 20, 2023 22:56
@ahcorde ahcorde merged commit 8fba3b4 into gazebosim:ros2 Dec 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants