summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorSubha sree Mohankumar <smohanku@redhat.com>2017-11-20 14:06:56 +0530
committerAmar Tumballi <amarts@redhat.com>2017-12-02 11:34:52 +0000
commit5eea1756016c55e4138d582e34d0069744772f72 (patch)
tree2210bd2cf9a1503c263331705a008443e4f0d6cc /xlators/mgmt/glusterd/src
parent185917c7a621ce0971e883b35221895ef235ca18 (diff)
glusterd:buffer_size_warning coverity fixes
Fixes Issues :15,17,18,19,24,38 Change-Id: Ib09d319308e4ef7dfbdd5e49e16064d4f55a54f9 BUG: 789278 Signed-off-by: Subha sree Mohankumar <smohanku@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 93d45163fd7..73d632110a3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -448,6 +448,7 @@ _glusterd_urltransform_add_iter (dict_t *dict, char *key, data_t *value, void *d
gf_msg_debug (this->name, 0, "value->data %s", value->data);
strncpy (slv_url, value->data, sizeof(slv_url));
+ slv_url[sizeof(slv_url) - 1] = 0;
ret = parse_slave_url (slv_url, &slave);
if (ret == -1) {
gf_msg (this->name, GF_LOG_ERROR, 0,
@@ -1287,6 +1288,7 @@ _get_status_mst_slv (dict_t *dict, char *key, data_t *value, void *data)
GF_VALIDATE_OR_GOTO (this->name, priv, out);
strncpy (slv_url, value->data, sizeof(slv_url));
+ slv_url[sizeof(slv_url) - 1] = 0;
ret = parse_slave_url (slv_url, &slave);
if (ret == -1) {
gf_msg (this->name, GF_LOG_ERROR, 0,
@@ -1531,6 +1533,7 @@ update_slave_voluuid (dict_t *dict, char *key, data_t *value, void *data)
*/
if (cnt == 4) {
strncpy (slv_url, value->data, sizeof(slv_url));
+ slv_url[sizeof(slv_url) - 1] = 0;
ret = parse_slave_url (slv_url, &slave);
if (ret == -1) {
@@ -1828,6 +1831,7 @@ glusterd_op_verify_gsync_start_options (glusterd_volinfo_t *volinfo,
/* check session directory as statefile may not present
* during upgrade */
strncpy (statefiledir, statefile, sizeof(statefiledir));
+ statefiledir[sizeof(statefiledir) - 1] = 0;
statedir = dirname (statefiledir);
ret = sys_lstat (statedir, &stbuf);
@@ -3225,6 +3229,7 @@ glusterd_op_stage_gsync_create (dict_t *dict, char **op_errstr)
}
strncpy (statefiledir, statefile, sizeof(statefiledir));
+ statefiledir[sizeof(statefiledir) - 1] = 0;
statedir = dirname (statefiledir);
ret = sys_lstat (statedir, &stbuf);
@@ -3550,6 +3555,7 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
/* check session directory as statefile may not present
* during upgrade */
strncpy (statefiledir, statefile, sizeof(statefiledir));
+ statefiledir[sizeof(statefiledir) - 1] = 0;
statedir = dirname (statefiledir);
ret = sys_lstat (statedir, &stbuf);