fix dangerous usage of volname because strncpy does not always null-terminated. Signed-off-by: Ruoyu <liangry@xxxxxxxxx> --- xlators/nfs/server/src/nfs-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c index f74396e..1462c1b 100644 --- a/xlators/nfs/server/src/nfs-common.c +++ b/xlators/nfs/server/src/nfs-common.c @@ -85,7 +85,7 @@ nfs_mntpath_to_xlator (xlator_list_t *cl, char *path) if ((!cl) || (!path)) return NULL; - strncpy (volname, path, MNTPATHLEN); + snprintf (volname, sizeof(volname), "%s", path); pathlen = strlen (volname); gf_log (GF_NFS, GF_LOG_TRACE, "Subvolume search: %s", path); if (volname[0] == '/') -- 1.8.3.2 _______________________________________________ Gluster-devel mailing list Gluster-devel@xxxxxxxxxxx http://supercolony.gluster.org/mailman/listinfo/gluster-devel