Skip to content

Commit aa15666

Browse files
authored
Fix max lenght in UDP port string (#315)
* Fix max lenght in UDP port string * Fix CI Signed-off-by: Pablo Garrido <pablogs9@gmail.com> * Update * Linting * Update * Fix uncrustify --------- Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
1 parent d4d26af commit aa15666

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ jobs:
2222

2323
- name: Download dependencies
2424
run: |
25-
apt update && apt install -y python3-pip git python3-rosdep python3-colcon-common-extensions curl ros-$ROS_DISTRO-performance-test-fixture
25+
apt update && apt install -y python3-pip git python3-rosdep python3-colcon-common-extensions curl ros-$ROS_DISTRO-performance-test-fixture gcovr
2626
git clone -b ros2 https://github.com/eProsima/Micro-CDR src/Micro-CDR
2727
git clone -b ros2 https://github.com/eProsima/Micro-XRCE-DDS-Client src/Micro-XRCE-DDS-Client
2828
git clone -b rolling https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds
2929
git clone -b rolling https://github.com/ros2/rmw src/rmw
3030
touch src/rosidl_typesupport_microxrcedds/test/COLCON_IGNORE
3131
3232
# Install coverage tools
33-
pip3 install gcovr
3433
. /opt/ros/$ROS_DISTRO/setup.sh
3534
rosdep init && rosdep update
3635
rosdep install --from-paths src -r
@@ -46,14 +45,14 @@ jobs:
4645
colcon test --event-handlers console_direct+ --packages-select=rmw_microxrcedds --return-code-on-test-failure
4746
./build/rmw_microxrcedds/test/test-sizes 2> memanalisys_out
4847
49-
- name: Static memory
50-
continue-on-error: true
51-
if: github.event_name == 'pull_request'
52-
uses: machine-learning-apps/pr-comment@master
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
with:
56-
path: memanalisys_out
48+
# - name: Static memory
49+
# continue-on-error: true
50+
# if: github.event_name == 'pull_request'
51+
# uses: machine-learning-apps/pr-comment@master
52+
# env:
53+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
# with:
55+
# path: memanalisys_out
5756

5857
- name: Coverage
5958
run: |

rmw_microxrcedds_c/include/rmw_microros/rmw_microros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extern "C"
4949
#elif defined(RMW_UXRCE_TRANSPORT_IPV6)
5050
#define MAX_IP_LEN 39
5151
#endif // ifdef RMW_UXRCE_TRANSPORT_IPV4
52-
#define MAX_PORT_LEN 5
52+
#define MAX_PORT_LEN 6 // uint16_t max size + NULL-end string
5353
#define MAX_SERIAL_DEVICE 50
5454

5555
typedef struct rmw_uxrce_transport_params_t

rmw_microxrcedds_c/src/rmw_graph.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ rmw_ret_t rmw_graph_init(
8484
graph_info->datareader_id = uxr_object_id(context->id_datareader++, UXR_DATAREADER_ID);
8585
const char * graph_topic_name = "ros_to_microros_graph";
8686
graph_info->graph_type_support =
87-
rosidl_typesupport_microxrcedds_c__get_message_type_support_handle__micro_ros_msgs__msg__Graph(); //NOLINT
87+
// NOLINTNEXTLINE
88+
rosidl_typesupport_microxrcedds_c__get_message_type_support_handle__micro_ros_msgs__msg__Graph();
8889

8990
// Create graph topic request
9091
graph_info->topic_id = uxr_object_id(context->id_topic++, UXR_TOPIC_ID);

rmw_microxrcedds_c/src/rmw_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ rmw_init_options_init(
9191
return RMW_RET_INVALID_ARGUMENT;
9292
}
9393

94-
if (strlen(RMW_UXRCE_DEFAULT_PORT) <= MAX_PORT_LEN) {
94+
if (strlen(RMW_UXRCE_DEFAULT_PORT) < MAX_PORT_LEN) {
9595
snprintf(
9696
init_options->impl->transport_params.agent_port,
9797
MAX_PORT_LEN, "%s", RMW_UXRCE_DEFAULT_PORT);

rmw_microxrcedds_c/src/rmw_microros/init_options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ rmw_ret_t rmw_uros_options_set_udp_address(
9797
return RMW_RET_INVALID_ARGUMENT;
9898
}
9999

100-
if (port != NULL && strlen(port) <= MAX_PORT_LEN) {
100+
if (port != NULL && strlen(port) < MAX_PORT_LEN) {
101101
snprintf(rmw_options->impl->transport_params.agent_port, MAX_PORT_LEN, "%s", port);
102102
} else {
103103
RMW_UROS_TRACE_MESSAGE("default port configuration error")

0 commit comments

Comments
 (0)