diff options
author | N Balachandran <nbalacha@redhat.com> | 2019-08-27 16:57:14 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-08-27 15:29:38 +0000 |
commit | 5a9ca4b99b256222acf200847c6d4e0447b95652 (patch) | |
tree | 7dc38cafaa64866c16e2a81f62b195bb50594110 /xlators/mgmt | |
parent | abc472524bc575773ec29c5856f12a29af3af350 (diff) |
glusterd: Fixed incorrect size argument
An incorrect size argument to snprintf caused
the glusterd process to crash on startup. This has been
fixed.
Change-Id: Iddafb5468866d0182cd8239210c92c893e643285
Fixes: bz#1745965
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 7da16ea0bac..c17f2859d9b 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -1447,9 +1447,10 @@ init(xlator_t *this) dir_data = dict_get(this->options, "cluster-test-mode"); if (!dir_data) { /* Use default working dir */ - len = snprintf(logdir, PATH_MAX, "%s", DEFAULT_LOG_FILE_DIRECTORY); + len = snprintf(logdir, VALID_GLUSTERD_PATHMAX, "%s", + DEFAULT_LOG_FILE_DIRECTORY); } else { - len = snprintf(logdir, PATH_MAX, "%s", dir_data->data); + len = snprintf(logdir, VALID_GLUSTERD_PATHMAX, "%s", dir_data->data); gf_msg(this->name, GF_LOG_INFO, 0, GD_MSG_CLUSTER_RC_ENABLE, "cluster-test-mode is enabled logdir is %s", dir_data->data); } |