Skip to content

Commit a905ae9

Browse files
committed
Address peer review comments
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
1 parent 533ea2b commit a905ae9

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

rcl/include/rcl/security.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ extern "C"
4747
# define ROS_SECURITY_ENABLE_VAR_NAME "ROS_SECURITY_ENABLE"
4848
#endif
4949

50-
/// Init the security options from the values of the environment variables and passed names.
50+
/// Initialize security options from values in the environment variables and given names.
5151
/**
52-
* Inits the passed security options based on the environment.
52+
* Initialize the given security options based on the environment.
5353
* For more details:
5454
* \sa rcl_security_enabled
5555
* \sa rcl_get_enforcement_policy

rcl/src/rcl/domain_id.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const char * const RCL_DOMAIN_ID_ENV_VAR = "ROS_DOMAIN_ID";
2626
rcl_ret_t
2727
rcl_get_default_domain_id(size_t * domain_id)
2828
{
29-
const char * ros_domain_id;
30-
const char * get_env_error_str;
29+
const char * ros_domain_id = NULL;
30+
const char * get_env_error_str = NULL;
3131

3232
if (!domain_id) {
3333
return RCL_RET_INVALID_ARGUMENT;

rcl/src/rcl/init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ rcl_init(
193193
}
194194

195195
TRACEPOINT(rcl_init, (const void *)context);
196+
196197
return RCL_RET_OK;
197198
fail:
198199
__cleanup_context(context);

rcl/src/rcl/security.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ rcl_get_security_options_from_environment(
4949
return ret;
5050
}
5151

52+
RCUTILS_LOG_DEBUG_NAMED(
53+
ROS_PACKAGE_NAME, "Using security: %s", use_security ? "true" : "false");
54+
5255
if (!use_security) {
5356
security_options->enforce_security = RMW_SECURITY_ENFORCEMENT_PERMISSIVE;
5457
return RMW_RET_OK;
5558
}
5659

57-
RCUTILS_LOG_DEBUG_NAMED(
58-
ROS_PACKAGE_NAME, "Using security: %s", use_security ? "true" : "false");
59-
6060
ret = rcl_get_enforcement_policy(&security_options->enforce_security);
6161
if (RCL_RET_OK != ret) {
6262
return ret;
@@ -201,7 +201,7 @@ static bool get_best_matching_directory(
201201
matched_name_length > max_match_length)
202202
{
203203
max_match_length = matched_name_length;
204-
memcpy(matched_name, file.name, max_match_length);
204+
strncpy(matched_name, file.name, max_match_length + 1);
205205
}
206206
}
207207
if (-1 == tinydir_next(&dir)) {

0 commit comments

Comments
 (0)