ros-drivers / rosserial

A ROS client library for small, embedded devices, such as Arduino. See: http://wiki.ros.org/rosserial
508 stars 527 forks source link

rosserial_server: Fix access to uninitialized memory in handling service calls #626

Open peci1 opened 6 months ago

peci1 commented 6 months ago

When handling a service call, the C++ server doesn't check that the service is available, and it also doesn't check whether the service succeeded. If the service fails, the caller should assume it has not touched the reference to the response object. But the response object passed here is an uninitialized ShapeShifter. Therefore, without this fix, the uninitialized ShapeShifter is published as the service response, which is super bad!

There was an unclear note about .call() not returning anything on windows. On Windows? Since when do the rosserial servers run on windows? I hope this was some mistake and actually checking the return value of .call() will not break anything that should work.