summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/dht/src/dht-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 3ccb89eccdd..db3b881b692 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1720,7 +1720,8 @@ dht_pathinfo_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (local->pathinfo) {
plen = strlen (local->pathinfo);
if (plen) {
- alloc_len += plen;
+ /* extra byte(s) for \0 to be safe */
+ alloc_len += (plen + 2);
local->pathinfo = GF_REALLOC (local->pathinfo,
alloc_len);
if (!local->pathinfo)