3604df
From 41f5f6c3d1450952afb255e0f2c0a2c61f921ecd Mon Sep 17 00:00:00 2001
3604df
From: Atin Mukherjee <amukherj@redhat.com>
3604df
Date: Tue, 6 Dec 2016 16:21:41 +0530
3604df
Subject: [PATCH 231/235] glusterfsd : fix null pointer dereference in
3604df
 glusterfs_handle_barrier
3604df
3604df
>Reviewed-on: http://review.gluster.org/16043
3604df
>Smoke: Gluster Build System <jenkins@build.gluster.org>
3604df
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
3604df
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
3604df
>Reviewed-by: Vijay Bellur <vbellur@redhat.com>
3604df
3604df
Change-Id: Iab86a3c4970e54c22d3170e68708e0ea432a8ea4
3604df
BUG: 1401817
3604df
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
3604df
Reviewed-on: https://code.engineering.redhat.com/gerrit/92447
3604df
---
3604df
 glusterfsd/src/glusterfsd-mgmt.c | 6 +++++-
3604df
 1 file changed, 5 insertions(+), 1 deletion(-)
3604df
3604df
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
3604df
index 38fb5b2..a12496e 100644
3604df
--- a/glusterfsd/src/glusterfsd-mgmt.c
3604df
+++ b/glusterfsd/src/glusterfsd-mgmt.c
3604df
@@ -1341,10 +1341,14 @@ glusterfs_handle_barrier (rpcsvc_request_t *req)
3604df
                 req->rpc_err = GARBAGE_ARGS;
3604df
                 goto out;
3604df
         }
3604df
+        ret = -1;
3604df
 
3604df
         ctx = glusterfsd_ctx;
3604df
-        GF_ASSERT (ctx);
3604df
+        GF_VALIDATE_OR_GOTO (THIS->name, ctx, out);
3604df
+
3604df
         active = ctx->active;
3604df
+        GF_VALIDATE_OR_GOTO (THIS->name, active, out);
3604df
+
3604df
         any = active->first;
3604df
 
3604df
         dict = dict_new();
3604df
-- 
3604df
2.9.3
3604df