summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authornik-redhat <nladha@redhat.com>2020-07-09 03:59:48 +0530
committernik-redhat <nladha@redhat.com>2020-07-09 04:09:12 +0530
commit906154bf2e5a65c438cb09fd318ca5f2f301b738 (patch)
treea9b9220fecc3a8c26bbcf8f2dc0299c950a8455c /xlators/mgmt/glusterd/src
parentd9ca07b41919cd754bd76a672a350bf536c09a09 (diff)
glusterd: dereference of null pointer
Issue: 'this' is used before it is defined, therefore it can lead to a NULL dereference. Fix: Moved the definition of 'this', before it's use to avoid NULL dereference. Change-Id: I6ad382192129dfa3a206426e5610040e7a905be6 Updates: #1096 Signed-off-by: nik-redhat <nladha@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index 08659a6..cafdffb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -670,6 +670,9 @@ __glusterd_handle_cli_heal_volume(rpcsvc_request_t *req)
0,
};
+ this = THIS;
+ GF_ASSERT(this);
+
GF_ASSERT(req);
ret = xdr_to_generic(req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
@@ -680,9 +683,6 @@ __glusterd_handle_cli_heal_volume(rpcsvc_request_t *req)
goto out;
}
- this = THIS;
- GF_ASSERT(this);
-
if (cli_req.dict.dict_len) {
/* Unserialize the dictionary */
dict = dict_new();