From 7403bddb58fc0db369d47671b8d4ca4cf221b4bc Mon Sep 17 00:00:00 2001 From: Vishal Pandey Date: Tue, 26 Sep 2017 11:55:25 +0530 Subject: 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 --- xlators/mgmt/glusterd/src/glusterd-handshake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src') 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; -- cgit