Skip to content

Commit

Permalink
Change from strcpy to memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
ruffsl committed Nov 10, 2018
1 parent dd19a8d commit db5f7a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rcl/src/rcl/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ const char * rcl_get_secure_root(
char * node_secure_root = NULL;
if (ros_secure_node_override) {
node_secure_root =
(char *)allocator->allocate(strlen(ros_secure_root_env) + 1, allocator->state);
strcpy(node_secure_root, ros_secure_root_env);
(char *)allocator->allocate(ros_secure_root_size + 1, allocator->state);
memcpy(node_secure_root, ros_secure_root_env, ros_secure_root_size + 1);
// TODO(ros2team): This make an assumption on the value and length of the root namespace.
// This should likely come from another (rcl/rmw?) function for reuse.
// If the namespace is the root namespace ("/"), the secure root is just the node name.
Expand Down

0 comments on commit db5f7a1

Please sign in to comment.