summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-resolve.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-17 22:52:11 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-17 23:35:00 -0700
commit0693997b778d1f3c328f0ad0d6ab8b1ad3be6b72 (patch)
treebd89f6cc1f17deb50f59cd2969495dfe4b0af9ea /xlators/protocol/server/src/server-resolve.c
parent1f7610608c4888fecc416a46b52d35c791a5116f (diff)
server-resolve: check for variables before dereferencing
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1628 (glusterfs crash) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1628
Diffstat (limited to 'xlators/protocol/server/src/server-resolve.c')
-rw-r--r--xlators/protocol/server/src/server-resolve.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c
index 8489bc4..8a39068 100644
--- a/xlators/protocol/server/src/server-resolve.c
+++ b/xlators/protocol/server/src/server-resolve.c
@@ -215,10 +215,12 @@ resolve_deep_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
resolve->deep_loc.inode = inode_new (state->itable);
resolve->deep_loc.name = components[i].basename;
- STACK_WIND_COOKIE (frame, resolve_deep_cbk, (void *) (long) i,
- BOUND_XL (frame), BOUND_XL (frame)->fops->lookup,
- &resolve->deep_loc, NULL);
- return 0;
+ if (frame && frame->root->state && BOUND_XL (frame)) {
+ STACK_WIND_COOKIE (frame, resolve_deep_cbk, (void *) (long) i,
+ BOUND_XL (frame), BOUND_XL (frame)->fops->lookup,
+ &resolve->deep_loc, NULL);
+ return 0;
+ }
get_out_of_here:
resolve_deep_continue (frame);
@@ -247,9 +249,14 @@ resolve_path_deep (call_frame_t *frame)
resolve->deep_loc.path = gf_strdup ("/");
resolve->deep_loc.name = "";
- STACK_WIND_COOKIE (frame, resolve_deep_cbk, (void *) (long) i,
- BOUND_XL (frame), BOUND_XL (frame)->fops->lookup,
- &resolve->deep_loc, NULL);
+ if (frame && frame->root->state && BOUND_XL (frame)) {
+ STACK_WIND_COOKIE (frame, resolve_deep_cbk, (void *) (long) i,
+ BOUND_XL (frame), BOUND_XL (frame)->fops->lookup,
+ &resolve->deep_loc, NULL);
+ return 0;
+ }
+
+ resolve_deep_continue (frame);
return 0;
}