diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index dd81887ed1f..b59d3819d95 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -471,6 +471,7 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo, struct args_pack pack = {0,}; xlator_t *this = NULL; GF_UNUSED int caps = 0; + int32_t len = 0; GF_ASSERT (volinfo); GF_ASSERT (volumes); @@ -654,8 +655,12 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo, char brick[1024] = {0,}; char brick_uuid[64] = {0,}; snprintf (key, 256, "volume%d.brick%d", count, i); - snprintf (brick, 1024, "%s:%s", brickinfo->hostname, - brickinfo->path); + len = snprintf (brick, 1024, "%s:%s", brickinfo->hostname, + brickinfo->path); + if ((len < 0) || (len >= 1024)) { + ret = -1; + goto out; + } buf = gf_strdup (brick); ret = dict_set_dynstr (volumes, key, buf); if (ret) |