From d37eec9667319f8d6553b030ea06f56493d1a249 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 21 May 2012 09:05:23 +0530 Subject: protocol/server: fix a crash with NULL dereference in setxattr() and fsetxattr() _cbk functions Change-Id: I9798d182e7f68509e8e37d43cb18e4c2f4bd6fab Signed-off-by: Amar Tumballi BUG: 823244 Reviewed-on: http://review.gluster.com/3384 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/protocol/server/src/server3_1-fops.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xlators/protocol/server/src/server3_1-fops.c') diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index c652dd5b3e2..2e0bbb4c8cd 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -901,7 +901,9 @@ server_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, "%"PRId64": SETXATTR %s (%s) ==> %s (%s)", frame->root->unique, state->loc.path, state->loc.inode ? uuid_utoa (state->loc.inode->gfid) : - "--", state->dict->members_list->key, + "--", ((state->dict) ? ((state->dict->members_list) ? + state->dict->members_list->key : + "(null)") : ("null")), strerror (op_errno)); } @@ -940,7 +942,10 @@ server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, "%"PRId64": FSETXATTR %"PRId64" (%s) ==> %s (%s)", frame->root->unique, state->resolve.fd_no, state->fd ? uuid_utoa (state->fd->inode->gfid) : "--", - state->dict->members_list->key, strerror (op_errno)); + ((state->dict) ? ((state->dict->members_list) ? + state->dict->members_list->key : + "(null)") : "null"), + strerror (op_errno)); GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&rsp.xdata.xdata_val), rsp.xdata.xdata_len, op_errno, out); -- cgit