Skip to content

[fix] nmea callback: remove \0 bytes to avoid CDR crash#276

Open
remco-r wants to merge 1 commit into
KumarRobotics:ros2from
remco-r:fix/cdr_crash_on_bad_nmea_data
Open

[fix] nmea callback: remove \0 bytes to avoid CDR crash#276
remco-r wants to merge 1 commit into
KumarRobotics:ros2from
remco-r:fix/cdr_crash_on_bad_nmea_data

Conversation

@remco-r

@remco-r remco-r commented May 8, 2026

Copy link
Copy Markdown

In my setup (moving base 2x ublox F9P, ROS2 Jazzy) RTCM messages are published on the same UART channel as connection to my PC. This driver currently wrongly interprets this as NMEA.
'\0' bytes in the RTCM messages will come in. and are processed by FastCDR to the ROS middleware. The new FastCDR 2.2.7, throws when serializing '\0' bytes to characters, making the driver crash.

terminate called after throwing an instance of 'eprosima::fastcdr::exception::BadParamException'
  what():  The string contains null characters

This fixes it, but proper handling of RTCM messages is adviced.
Valid NMEA is ASCII and never contains \0 byte, legitimate NMEA will not be deleted.

publish.nmea: false should also avoid the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant