summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-05-21 09:05:23 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-21 00:39:45 -0700
commit4746ed1a055c595f08445d5a670e9585f8209183 (patch)
tree4aef01d35f75d4478ec479c5b944eba09b609bb9 /xlators/protocol/server/src
parent1d939fe7adef651b90bb5c4cd5843768417f0138 (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/3385 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/protocol/server/src')
-rw-r--r--xlators/protocol/server/src/server3_1-fops.c9
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);