summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index 8414fa8e9bb..72e479070b6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -296,7 +296,7 @@ gotvolinfo:
ret = stat (path, &stbuf);
if ((ret == -1) && (errno == ENOENT)) {
- strcpy (dup_volid, volid_ptr);
+ strncpy (dup_volid, volid_ptr, (PATH_MAX - 1));
if (!strchr (dup_volid, '.')) {
switch (volinfo->transport_type) {
case GF_TRANSPORT_TCP:
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 1ea2f357026..d81ee435840 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -284,7 +284,7 @@ glusterd_dump_peer (glusterd_peerinfo_t *peerinfo, char *input_key, int index,
char subkey[50] = {0,};
char key[GF_DUMP_MAX_BUF_LEN] = {0,};
- strcpy (key, input_key);
+ strncpy (key, input_key, (GF_DUMP_MAX_BUF_LEN - 1));
snprintf (subkey, sizeof (subkey), "%s%d", key, index);
@@ -327,7 +327,7 @@ glusterd_dump_peer_rpcstat (glusterd_peerinfo_t *peerinfo, char *input_key,
char subkey[50] = {0,};
char key[GF_DUMP_MAX_BUF_LEN] = {0,};
- strcpy (key, input_key);
+ strncpy (key, input_key, (GF_DUMP_MAX_BUF_LEN - 1));
/* Dump the rpc connection statistics */
rpc = peerinfo->rpc;