diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2018-08-16 10:03:22 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-17 02:50:14 +0000 |
commit | fa16371475a115213390cd84d38cec75032f24d4 (patch) | |
tree | 8966e7efdc415d38f00200a9cfd9fb130f099542 | |
parent | 0f0551565874498242348fbe413017d844715814 (diff) |
glusterd: coverity defects fix introduced by commit 1f3bfe7
Commit 1f3bfe7 stripped down the total size of certain path related variables
in glusterd_brickinfo_t which considered couple of new coverity defects.
Fix the following:
CID : 1394969 Destination buffer too small
CID : 1394968 Out-of-bounds access
Change-Id: Ibc30eac4680cc6c83bd89d248f1435cb6a3d1b75
updates: bz#789278
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 814aa754d97..028fb78857e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -3601,7 +3601,7 @@ glusterd_recreate_vol_brick_mounts (xlator_t *this, glusterd_brickinfo_t *brickinfo = NULL; int32_t ret = -1; struct stat st_buf = {0, }; - char abspath[PATH_MAX] = {0}; + char abspath[VALID_GLUSTERD_PATHMAX] = {0}; GF_ASSERT (this); GF_ASSERT (volinfo); diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 362d3b6adc4..7ede0245808 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1191,7 +1191,7 @@ glusterd_get_brick_mount_dir (char *brickpath, char *hostname, char *mount_dir) brick_dir = &brickpath[strlen (mnt_pt)]; brick_dir++; - snprintf (mount_dir, PATH_MAX, "/%s", brick_dir); + snprintf (mount_dir, VALID_GLUSTERD_PATHMAX, "/%s", brick_dir); } out: |