summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2017-03-09 12:49:27 -0500
committerVijay Bellur <vbellur@redhat.com>2017-03-09 21:14:33 -0500
commit90b2b9b29f552fe9ab53de5c4123003522399e6d (patch)
tree9e7e036828e567f374d0b8b7f6a6576cb1421f7b /libglusterfs
parent53e2c875cf97df8337f7ddb5124df2fc6dd37bca (diff)
glusterfsd+libglusterfs: add null checks during attach
It's possible (though unlikely) that we could get a brick-attach request while we're not ready to process it (ctx->active not set yet). Add code to guard against this possibility, and return appropriate error indicators. Change-Id: Icb3bc52ce749258a3f03cbbbdf4c2320c5c541a0 BUG: 1430860 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: https://review.gluster.org/16883 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/graph.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index 0c7d6cf6101..916942c3a2d 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -1040,6 +1040,10 @@ glusterfs_graph_attach (glusterfs_graph_t *orig_graph, char *path)
xlator_t *xl;
char *volfile_id;
+ if (!orig_graph) {
+ return -EINVAL;
+ }
+
fp = fopen (path, "r");
if (!fp) {
gf_log (THIS->name, GF_LOG_WARNING,