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 z_view_string_t to std::string conversion #45

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

fuzzypixelz
Copy link
Member

Using AddressSanitizer, I found instances where a z_view_string_t was used to construct an std::string as if it was null-terminated, leading to rmw_zenoh reading garbage bytes.

@fuzzypixelz fuzzypixelz added the bug Something isn't working label Nov 25, 2024
@fuzzypixelz fuzzypixelz self-assigned this Nov 25, 2024
Copy link

@evshary evshary left a comment

Choose a reason for hiding this comment

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

LGTM. I think the CI failure is not caused by the changes.
Our dev/1.0.0 failed the CI again for an unknow issue

@YuanYuYuan
Copy link
Collaborator

Thanks @fuzzypixelz . Indeed, any plain z_string_data without length is wrongly used in the rmw_zenoh. I'll merge it and check the building error as I've already been working on this.

BTW, the solution to this is to construct a std::string to properly wrap it, but I think it could be improved. See ros2#325

@YuanYuYuan YuanYuYuan merged commit 0dffa49 into dev/1.0.0 Nov 27, 2024
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants