summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/glusterfs.h
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-10-12 14:25:00 +0530
committerAmar Tumballi <amarts@redhat.com>2018-10-12 15:39:03 +0000
commitc962e2cbd73e78f31e690f7b1f8456616006c543 (patch)
tree49ac30d65280a5a2d5ef391b776535c37d5bbc66 /libglusterfs/src/glusterfs.h
parentac074e03437faf6f2f0897e6d9e7249ac0599b64 (diff)
glusterd/geo-rep: Fix memory corruption
Problem and Analysis: The length of canonical format of uuid is 36 but 'GF_UUID_BUF_SIZE 50' was being used everywhere. glusterd/geo-rep code was earlier using strncpy, but recently changes to memcpy with the drive to avoid strncpys. This leads to memory corruption and glusterd is crashing without a core with geo-rep creation with ASAN build. Fix: 'GF_UUID_BUF_SIZE 37' (+ 1 for NULL byte) And change geo-rep to use UUID_CANONICAL_FORM_LEN instead Updates: bz#1633930 Change-Id: Ibd347d542b92e64a96ce06780cda643557233bc7 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs.h')
-rw-r--r--libglusterfs/src/glusterfs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 376b7a7c673..1ebe2d8d1cd 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -284,7 +284,7 @@ enum gf_internal_fop_indicator {
/* GlusterFS's maximum supported Auxiliary GIDs */
#define GF_MAX_AUX_GROUPS 65535
-#define GF_UUID_BUF_SIZE 50
+#define GF_UUID_BUF_SIZE 37 /* UUID_CANONICAL_FORM_LEN + NULL */
#define GF_UUID_BNAME_BUF_SIZE (320) /* (64 + 256) */
#define GF_REBALANCE_TID_KEY "rebalance-id"