summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
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/mgmt
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/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index e0864c04148..71ac45cd241 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -221,7 +221,7 @@ typedef enum gf_brick_status {
} gf_brick_status_t;
struct glusterd_brickinfo {
- char hostname[1024];
+ char hostname[NAME_MAX];
char path[VALID_GLUSTERD_PATHMAX];
char real_path[VALID_GLUSTERD_PATHMAX];
char device_path[VALID_GLUSTERD_PATHMAX];
@@ -407,12 +407,15 @@ struct glusterd_volinfo_ {
the volume which is snapped. In
case of a non-snap volume, this
field will be initialized as N/A */
- char volname[GD_VOLUME_NAME_MAX + 5];
- /* An extra 5 bytes are allocated.
- * Reason is, As part of the tiering
+ char volname[NAME_MAX + 1];
+ /* NAME_MAX + 1 will be equal to
+ * GD_VOLUME_NAME_MAX + 5.(also to
+ * GD_VOLUME_NAME_MAX_TIER). An extra 5
+ * bytes are added to GD_VOLUME_NAME_MAX
+ * because, as part of the tiering
* volfile generation code, we are
- * temporarily appending either hot
- * or cold */
+ * temporarily appending either "-hot"
+ * or "-cold" */
int type;
int brick_count;
uint64_t snap_count;