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