From 29f2de478cc6a475e6ae760d9cbe7ac847e9d79c Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 13 Apr 2012 17:29:41 +0530 Subject: core: coverity issues fixed this is not a complete set of issues getting fixed. Will address other issues in another patch. Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69 Signed-off-by: Amar Tumballi BUG: 789278 Reviewed-on: http://review.gluster.com/3145 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- cli/src/cli-cmd-volume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 3f76b6150da..ea7a13761e3 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1588,7 +1588,7 @@ cli_print_brick_status (cli_volume_status_t *status) while (bricklen > 0) { if (bricklen > fieldlen) { i++; - strncpy (buf, p, fieldlen); + strncpy (buf, p, min (fieldlen, (sizeof (buf)-1))); buf[strlen(buf) + 1] = '\0'; cli_out ("%s", buf); p = status->brick + i * fieldlen; -- cgit