From a45ac57e4e12a32f7136f22c2eb0519fbd61354c Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 2 Jul 2010 12:48:10 +0000 Subject: allocate space for '\0' in string, while adding xlator-option Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 1044 ('--xlator-option' is not working) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1044 --- glusterfsd/src/glusterfsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glusterfsd/src') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 01d155a2d..13217836c 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -348,7 +348,7 @@ gf_remember_xlator_option (struct list_head *options, char *arg) if (!dot) goto out; - option->volume = GF_CALLOC ((dot - arg), sizeof (char), + option->volume = GF_CALLOC ((dot - arg) + 1, sizeof (char), gfd_mt_char); strncpy (option->volume, arg, (dot - arg)); @@ -356,7 +356,7 @@ gf_remember_xlator_option (struct list_head *options, char *arg) if (!equals) goto out; - option->key = GF_CALLOC ((equals - dot), sizeof (char), + option->key = GF_CALLOC ((equals - dot) + 1, sizeof (char), gfd_mt_char); strncpy (option->key, dot + 1, (equals - dot - 1)); -- cgit