summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index a66e04934db..47ac842193e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -3284,8 +3284,9 @@ glusterd_import_new_brick (dict_t *peer_data, int32_t vol_count,
if (ret)
goto out;
- strcpy (new_brickinfo->path, path);
- strcpy (new_brickinfo->hostname, hostname);
+ strncpy (new_brickinfo->path, path, sizeof (new_brickinfo->path) - 1);
+ strncpy (new_brickinfo->hostname, hostname,
+ sizeof (new_brickinfo->hostname) - 1);
new_brickinfo->decommissioned = decommissioned;
if (brick_id)
strcpy (new_brickinfo->brick_id, brick_id);