summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
diff options
context:
space:
mode:
authorSakshi Bansal <sabansal@redhat.com>2015-02-03 13:05:02 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-06-10 01:50:04 -0700
commit9374b2ef417104ba51bc03a55ff8c5a521c749f4 (patch)
tree203283a354f6f5006254c7295cdfbb98a1c1c88e /xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
parent9307b943947daa1fe93afdeef5bfae606423b38a (diff)
glusterd: coverity fix for string overflow
Coverity CID: 1222523 Coverity CID: 1210990 Coverity CID: 1229877 Coverity CID: 1229876 Coverity CID: 1124855 Change-Id: Iba615724909216f923074cb4585940b919d02166 BUG: 789278 Signed-off-by: Sakshi Bansal <sabansal@redhat.com> Reviewed-on: http://review.gluster.org/9555 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
index f0b4b815c16..6ab0403993a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
@@ -839,7 +839,8 @@ gd_import_new_brick_snap_details (dict_t *dict, char *prefix,
"%s missing in payload", key);
goto out;
}
- strcpy (brickinfo->mount_dir, mount_dir);
+ strncpy (brickinfo->mount_dir, mount_dir,
+ (sizeof (brickinfo->mount_dir) - 1));
out:
return ret;
@@ -1497,7 +1498,7 @@ glusterd_import_friend_snap (dict_t *peer_data, int32_t snap_count,
goto out;
}
- strcpy (snap->snapname, peer_snap_name);
+ strncpy (snap->snapname, peer_snap_name, sizeof (snap->snapname) - 1);
gf_uuid_parse (peer_snap_id, snap->snap_id);
snprintf (buf, sizeof(buf), "%s.snapid", prefix);