summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c5
3 files changed, 8 insertions, 5 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);
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index c8911defd3b..9cb6095020e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -4717,7 +4717,8 @@ glusterd_add_brick_to_snap_volume (dict_t *dict, dict_t *rsp_dict,
if (!ret) {
/* Update the fstype in original brickinfo as well */
strcpy (original_brickinfo->fstype, value);
- strcpy (snap_brickinfo->fstype, value);
+ strncpy (snap_brickinfo->fstype, value,
+ (sizeof (snap_brickinfo->fstype) - 1));
} else {
if (is_origin_glusterd (dict) == _gf_true)
add_missed_snap = _gf_true;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 5e99ee99550..996cf89bb4a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -5535,7 +5535,7 @@ glusterd_is_path_in_use (char *path, gf_boolean_t *in_use, char **op_errstr)
if (!path)
goto out;
- strcpy (dir, path);
+ strncpy (dir, path, (sizeof (dir) - 1));
curdir = dir;
do {
for (i = 0; !used && keys[i]; i++) {
@@ -9336,7 +9336,8 @@ glusterd_update_mntopts (char *brick_path, glusterd_brickinfo_t *brickinfo)
goto out;
}
- strcpy (brickinfo->fstype, entry->mnt_type);
+ strncpy (brickinfo->fstype, entry->mnt_type,
+ (sizeof (brickinfo->fstype) - 1));
strcpy (brickinfo->mnt_opts, entry->mnt_opts);
ret = 0;