summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXie Changlong <xiechanglong@cmss.chinamobile.com>2019-07-05 15:16:23 +0800
committerAmar Tumballi <amarts@gmail.com>2019-11-22 06:01:58 +0000
commit855df074ea6d41195607e34126e494e19f5df0be (patch)
treeb5401dcaff6106c989ab88d05eab362b9e6b6fcd
parent16331f6df4f45dfce6f7e03afc2057b5b543bc93 (diff)
gnfs: use strcpy to prevent memory overflow
fixes: bz#1775495 Change-Id: Iea289032a8feecf2945668d3fb44a6a53089fdea Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com> (cherry picked from commit 99d210a704d2e85c95fac5edcf435bd059aad368)
-rw-r--r--xlators/nfs/server/src/mount3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index 734453ca6a2..177046ecf8c 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -2337,7 +2337,7 @@ __build_mountlist(struct mount3_state *ms, int *count)
goto free_list;
}
- strcat(mlist->ml_hostname, me->hostname);
+ strcpy(mlist->ml_hostname, me->hostname);
gf_msg_debug(GF_MNT, 0, "mount entry: dir: %s, host: %s",
mlist->ml_directory, mlist->ml_hostname);