diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-05-21 09:05:23 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-05-20 21:21:20 -0700 |
commit | d37eec9667319f8d6553b030ea06f56493d1a249 (patch) | |
tree | a9f1941f18cd0bc55c3a4e7686e478f7e3e6ec79 /xlators/protocol | |
parent | ad36d5b7349c7ff784116b12f5dada24121728df (diff) |
protocol/server: fix a crash with NULL dereference
in setxattr() and fsetxattr() _cbk functions
Change-Id: I9798d182e7f68509e8e37d43cb18e4c2f4bd6fab
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 823244
Reviewed-on: http://review.gluster.com/3384
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |