summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-helpers.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-07-23 03:13:19 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-23 04:28:49 -0700
commit9c2753d1bee735cb74968106c7ce8ca1460504c6 (patch)
tree56aad940b0a6edde276b633e331f15d622e2c0a1 /xlators/protocol/server/src/server-helpers.c
parentb12d471100bd7ade9b3a6c0d917e0416f1b62e9b (diff)
handle some NULL dereference in server protocol
which can happen due to un authenticated clients sending requests. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1195 (crash in protocol server due to unauthenticated fop request..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1195
Diffstat (limited to 'xlators/protocol/server/src/server-helpers.c')
-rw-r--r--xlators/protocol/server/src/server-helpers.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 216204a8b..37418ac1d 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -742,10 +742,15 @@ server_alloc_frame (rpcsvc_request_t *req)
server_connection_t *conn = NULL;
GF_VALIDATE_OR_GOTO("server", req, out);
+ GF_VALIDATE_OR_GOTO("server", req->conn, out);
+ GF_VALIDATE_OR_GOTO("server", req->conn->trans, out);
+ GF_VALIDATE_OR_GOTO("server", req->conn->svc, out);
+ GF_VALIDATE_OR_GOTO("server", req->conn->svc->ctx, out);
conn = (server_connection_t *)req->conn->trans->xl_private;
if (!conn)
goto out;
+
frame = create_frame (conn->this, req->conn->svc->ctx->pool);
GF_VALIDATE_OR_GOTO("server", frame, out);
@@ -753,7 +758,7 @@ server_alloc_frame (rpcsvc_request_t *req)
GF_VALIDATE_OR_GOTO("server", state, out);
if (conn->bound_xl)
- state->itable = conn->bound_xl->itable;
+ state->itable = conn->bound_xl->itable;
state->xprt = req->conn->trans;
state->conn = conn;