summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c4
1 files changed, 2 insertions, 2 deletions
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;