File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ const char * const RCL_DOMAIN_ID_ENV_VAR = "ROS_DOMAIN_ID";
2626rcl_ret_t
2727rcl_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 ;
Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ rcl_init(
193193 }
194194
195195 TRACEPOINT (rcl_init , (const void * )context );
196+
196197 return RCL_RET_OK ;
197198fail :
198199 __cleanup_context (context );
Original file line number Diff line number Diff 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 )) {
You can’t perform that action at this time.
0 commit comments