diff options
author | Sakshi Bansal <sabansal@redhat.com> | 2015-02-03 10:48:49 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-05-12 13:13:34 +0000 |
commit | 9dc37dd8aa57bea5b86ac4f2a44e31106aeb58ad (patch) | |
tree | 31cfd08e52bf678360b7d851b18b7a1b24894c66 /xlators/mgmt | |
parent | 3fc67c062b379562b8b121d5eed042a58cbb0b26 (diff) |
glusterd: coverity fix for string overflow
coverity CID: 1124852
Change-Id: Ifb04ad36b0652474007d2768737722231a5c1df0
BUG: 789278
Signed-off-by: Sakshi Bansal <sabansal@redhat.com>
Reviewed-on: https://review.gluster.org/9539
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index a66e04934db..47ac842193e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -3284,8 +3284,9 @@ glusterd_import_new_brick (dict_t *peer_data, int32_t vol_count, if (ret) goto out; - strcpy (new_brickinfo->path, path); - strcpy (new_brickinfo->hostname, hostname); + strncpy (new_brickinfo->path, path, sizeof (new_brickinfo->path) - 1); + strncpy (new_brickinfo->hostname, hostname, + sizeof (new_brickinfo->hostname) - 1); new_brickinfo->decommissioned = decommissioned; if (brick_id) strcpy (new_brickinfo->brick_id, brick_id); |