Skip to content

Commit

Permalink
Fix deserialization segfault in bionic.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcarroll committed May 1, 2018
1 parent 698de9c commit 788582d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ bool TypeSupport<MembersType>::deserializeROSmessage(
deserialize_field<uint64_t>(member, field, deser, call_new);
break;
case ::rosidl_typesupport_introspection_cpp::ROS_TYPE_STRING:
// Because std::string is a complex datatype, we need to make sure that
// the memory is initialized to something reasonable before eventually
// passing it as a reference to Fast-CDR.
if(!member->is_array_) {
new (field) std::string();
}
deserialize_field<std::string>(member, field, deser, call_new);
break;
case ::rosidl_typesupport_introspection_cpp::ROS_TYPE_MESSAGE:
Expand Down

0 comments on commit 788582d

Please sign in to comment.