Skip to content

Conversation

@mxgrey
Copy link
Collaborator

@mxgrey mxgrey commented Dec 9, 2024

The example message VariousTypes has a string<=3 with a default value containing three characters which each have a length of two bytes in utf-8. This means the real length of the default value is 6 bytes even though the byte limit is <=3.

This PR changes the default value to be "aou" to be three bytes long. The other bounded string is a wide string (utf-16), so it can remain as-is.

To observe the problem, use $ cargo run in the message_demo example to see it return an error code if you use the main branch. Then use the branch of this PR and see that it does not return an error code.

@esteve
Copy link
Collaborator

esteve commented Dec 9, 2024

@mxgrey thanks!

@esteve esteve merged commit 7f53a4e into ros2-rust:main Dec 9, 2024
6 checks passed
@mxgrey mxgrey deleted the bounded_sequence_overflow branch December 9, 2024 10:50
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.

2 participants