From 7e4d13b56022dfe57fc1512e247eb030edec17fb Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 21 Sep 2010 03:51:57 +0000 Subject: check the private structure of the xlator before accessing it Signed-off-by: Raghavendra Bhat Signed-off-by: Vijay Bellur BUG: 1651 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1651 --- xlators/protocol/client/src/client.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index e3e143d58b2..58ac7d0e62e 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1531,6 +1531,13 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, int ret = 0; this = mydata; + if (!this || !this->private) { + gf_log ("client", GF_LOG_ERROR, + (this != NULL)?"private structure of the xlator this is NULL": + "xlator this is NULL"); + goto out; + } + conf = this->private; switch (event) { @@ -1572,6 +1579,7 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, break; } +out: return 0; } -- cgit