Skip to content

Commit

Permalink
uxrce_dds_client: UDP transport string null termination fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jnippula committed Nov 8, 2024
1 parent 527d024 commit e4b7959
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/uxrce_dds_client/uxrce_dds_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ UxrceddsClient::UxrceddsClient(Transport transport, const char *device, int baud

#if defined(UXRCE_DDS_CLIENT_UDP)
_transport_udp = new uxrUDPTransport();
strncpy(_send_port, send_port, PORT_MAX_LENGTH - 1);
strncpy(_recv_port, recv_port, PORT_MAX_LENGTH - 1);
strncpy(_agent_ip, agent_ip, AGENT_IP_MAX_LENGTH - 1);
snprintf(_send_port, PORT_MAX_LENGTH, "%s", send_port);
snprintf(_recv_port, PORT_MAX_LENGTH, "%s", recv_port);
snprintf(_agent_ip, AGENT_IP_MAX_LENGTH, "%s", agent_ip);

if (_transport_udp) {
if (uxr_init_udp_transport(_transport_udp, UXR_IPv4, _agent_ip, _recv_port, _send_port)) {
Expand Down

0 comments on commit e4b7959

Please sign in to comment.