diff options
author | Barak Sason <bsasonro@redhat.com> | 2019-08-15 15:54:28 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2019-08-20 03:13:47 +0000 |
commit | c63a1f6ab0f2ff08e0a738f33558a3f8bdd87996 (patch) | |
tree | 016fe0792bcf540136764a86d5fec6c215e909fa /xlators/storage | |
parent | 8f1620ad7f5d3d040fee55c5f873349800e2268d (diff) |
storage/posix - Moved pointed validity check in order to avoid possible seg-fault
CID: 1124831
Updates: bz#789278
Change-Id: Ia6550be3742849809cf3e0a4a39d9d6e77003b35
Signed-off-by: Barak Sason <bsasonro@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix-common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index a80cf963d89..2b39b5bde53 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -102,13 +102,13 @@ posix_priv(xlator_t *this) struct posix_private *priv = NULL; char key_prefix[GF_DUMP_MAX_BUF_LEN]; + if (!this) + return 0; + (void)snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name); gf_proc_dump_add_section("%s", key_prefix); - if (!this) - return 0; - priv = this->private; if (!priv) |