summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Pandey <vishpandey2014@gmail.com>2017-09-26 11:55:25 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-11-08 18:06:07 +0000
commit7403bddb58fc0db369d47671b8d4ca4cf221b4bc (patch)
treeb92d4964d04b7b9ae10cd755a0d924c75461171a
parent175f6cc76038920feb27aa76f2401765c1d8cefd (diff)
glusterd: Coverity Issue FORWARD_NULL fix
Problems: According to Coverity Issue ID 207 issues are as follows- a-) Dereferencing "this" pointer without checking if it points to NULL. b-) The IF condition on line 1750 should check if any *one* of dict, this or peerinfo is NULL and not *all*. Fix: Replace the && operator with || to check if any *one* of this, dict or peerinfo is NULL and then execute out label. Change-Id: I40057d6cade71d3862c8e491bf4137cf25dda327 BUG: 789278 Signed-off-by: Vishal Pandey <vishpandey2014@gmail.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index 319c99f65db..a649e9f61be 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -1792,7 +1792,7 @@ gd_validate_peer_op_version (xlator_t *this, glusterd_peerinfo_t *peerinfo,
int32_t peer_min_op_version = 0;
int32_t peer_max_op_version = 0;
- if (!dict && !this && !peerinfo)
+ if (!dict || !this || !peerinfo)
goto out;
conf = this->private;