summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 3806127f00c..b56e9f26379 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3728,7 +3728,8 @@ build_distribute:
goto out;
}
if (volinfo->tier_info.hot_brick_count) {
- strcpy (tmp_volname, volinfo->volname);
+ strncpy (tmp_volname, volinfo->volname,
+ strlen (volinfo->volname));
if (volinfo->tier_info.cur_tier_hot)
strcat (volinfo->volname, "-hot");
else
@@ -5170,7 +5171,7 @@ glusterd_is_valid_volfpath (char *volname, char *brick)
ret = 0;
goto out;
}
- strncpy (volinfo->volname, volname, sizeof (volinfo->volname));
+ strncpy (volinfo->volname, volname, strlen (volname));
get_brick_filepath (volfpath, volinfo, brickinfo, NULL);
ret = ((strlen(volfpath) < PATH_MAX) &&