...
<***removed***>/ws_rmw_zenoh/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp: In function ‘std::string rmw_zenoh_cpp::liveliness::zid_to_str(const z_id_t&)’:
<***removed***>/ws_rmw_zenoh/src/rmw_zenoh/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp:228:12: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
228 | for (; i >= 0; i--) {
| ~~^~~~
---
...
The compiler warning gives a hint:
The variable
i
is of typesize_t
and will wrap. It is then possible that we will eventually access an invalid memory location. https://github.com/ros2/rmw_zenoh/blob/e6864931cccfc9c504b4bbc3ae7899334e70fdae/rmw_zenoh_cpp/src/detail/liveliness_utils.cpp#L228Terminal 1:
Terminal 2:
rmw_zenoh: e6864931cccfc9c504b4bbc3ae7899334e70fdae ROS release: jazzy