From 7da8040d96ae16d6d2b6079ffd8cbcfe5d28aac4 Mon Sep 17 00:00:00 2001 From: meghana Date: Tue, 20 Aug 2013 15:13:42 -0400 Subject: NFS : Coverity Fix. NFS defects reported by Coverity run are fixed. Change-Id: Ib66847e8e66fb4a06b312c80814f9eafb032eba2 BUG: 996390 Signed-off-by: meghana Reviewed-on: http://review.gluster.org/5660 Tested-by: Gluster Build System Reviewed-by: Varun Shastry Reviewed-by: Kaleb KEITHLEY --- xlators/nfs/server/src/nfs3-fh.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xlators/nfs/server/src/nfs3-fh.c') diff --git a/xlators/nfs/server/src/nfs3-fh.c b/xlators/nfs/server/src/nfs3-fh.c index c4f59a622..3ca61056b 100644 --- a/xlators/nfs/server/src/nfs3-fh.c +++ b/xlators/nfs/server/src/nfs3-fh.c @@ -120,17 +120,17 @@ nfs3_fh_is_root_fh (struct nfs3_fh *fh) void -nfs3_fh_to_str (struct nfs3_fh *fh, char *str) +nfs3_fh_to_str (struct nfs3_fh *fh, char *str, size_t len) { - char gfid[512]; - char exportid[512]; + char gfid[GF_UUID_BUF_SIZE]; + char exportid[GF_UUID_BUF_SIZE]; if ((!fh) || (!str)) return; - sprintf (str, "FH: exportid %s, gfid %s", - uuid_utoa_r (fh->exportid, exportid), - uuid_utoa_r (fh->gfid, gfid)); + snprintf (str, len, "FH: exportid %s, gfid %s", + uuid_utoa_r (fh->exportid, exportid), + uuid_utoa_r (fh->gfid, gfid)); } void -- cgit