magazino / move_base_flex

Move Base Flex: a backwards-compatible replacement for move_base
https://uos.github.io/mbf_docs/
BSD 3-Clause "New" or "Revised" License
429 stars 154 forks source link

Hotfix: Prevent unrelated type casts for Cell #197

Closed FabianSchurig closed 4 years ago

FabianSchurig commented 4 years ago

Hello @corot and @spuetz,

An 'unsigned int' value was c-style casted to an unrelated type 'uint16_t' (aka 'unsigned short'). The width of both data models might differ on platforms. Thus, memory is accessed out-of-bounds which results in non-deterministic return values of the CheckPath service and probably other methods of the FootprintHelper.

I created two small examples demonstrating the issue with godbolt:

https://godbolt.org/z/rxpvjM https://godbolt.org/z/X-pibJ

Best Fabian