Skip to content

Commit

Permalink
Fix buffer overflow for bounded sequence example (#444)
Browse files Browse the repository at this point in the history
* Fix buffer overflow for bounded sequence example

Signed-off-by: Michael X. Grey <greyxmike@gmail.com>

* Allow longer characters for wstring

Signed-off-by: Michael X. Grey <greyxmike@gmail.com>

---------

Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
  • Loading branch information
mxgrey authored Dec 9, 2024
1 parent f706824 commit 7f53a4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/message_demo/src/message_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn check_default_values() {
assert_eq!(msg.float_seq_unbounded, seq![6.0]);
assert_eq!(msg.string_member.to_string(), "Χαίρετε 你好");
assert_eq!(msg.wstring_member.to_string(), "αντίο σου 再见");
assert_eq!(msg.bounded_string_member.to_string(), "äöü");
assert_eq!(msg.bounded_string_member.to_string(), "aou");
assert_eq!(msg.bounded_wstring_member.to_string(), "äöü");
assert_eq!(
msg.string_array.clone().map(|s| s.to_string()),
Expand Down
2 changes: 1 addition & 1 deletion examples/rclrs_example_msgs/msg/VariousTypes.msg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ float32[] float_seq_unbounded [6.0]
# String types
string string_member "Χαίρετε 你好"
wstring wstring_member "αντίο σου 再见"
string<=3 bounded_string_member "äöü"
string<=3 bounded_string_member "aou"
wstring<=3 bounded_wstring_member "äöü"

# Array/sequence of string type
Expand Down

0 comments on commit 7f53a4e

Please sign in to comment.