summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2018-08-29 00:18:32 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-09-04 14:01:59 +0000
commit8612a1ca192333c2b760455661647d83bed2fd92 (patch)
tree238fbeab56fbfff4182583d89c9829197ba28876 /xlators/cluster/afr/src/afr-common.c
parent13298d2b3893edb5d147ea3bcb9902ee5be4b3ad (diff)
glusterd: Fix Buffer size issues
This patch fixes buffer size issue 1138522. Change-Id: Ia12fc8f34f75704f8ed3efae2022c4fd67a8c76c updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 0b1d462..702973a 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -6403,11 +6403,11 @@ afr_get_split_brain_status (void *opaque)
/* Calculation for string length :
* (child_count X length of child-name) + strlen (" Choices :")
* child-name consists of :
- * a) 256 = max characters for volname according to GD_VOLUME_NAME_MAX
+ * a) 251 = max characters for volname according to GD_VOLUME_NAME_MAX
* b) strlen ("-client-00,") assuming 16 replicas
*/
- choices = alloca0 (priv->child_count * (256 + strlen ("-client-00,")) +
- strlen (" Choices:"));
+ choices = alloca0 (priv->child_count * (251 + sizeof("-client-00,")) +
+ sizeof(" Choices:"));
ret = afr_is_split_brain (frame, this, inode, loc->gfid, &d_spb,
&m_spb);