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 ac9a4def054..7d263b43aeb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3529,7 +3529,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
@@ -4958,7 +4959,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) &&