summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-04-16 13:26:40 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-16 11:39:13 -0700
commit41bd7281a5fe4062fabe963d7862117aca50cc3d (patch)
treebea681859158f78a04afbceb1136ecb07a600ca7 /xlators
parent754112b7b716c68fb6cf44941ce4f343698d533e (diff)
features/marker: fix possible NULL access in strcmp()
for a given setxattr call, loc->path can be NULL now, handle that case properly Change-Id: Ic56ec81aa8eb62aafdb524bf22f6d84390ab1d4b Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 812767 Reviewed-on: http://review.gluster.com/3154 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/marker/src/marker.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 567e9467c28..b2275944b31 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -358,9 +358,15 @@ marker_specific_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto out;
}
- if (strcmp (local->loc.path, "/") == 0) {
- done = 1;
- goto out;
+ if (local) {
+ if (local->loc.path && strcmp (local->loc.path, "/") == 0) {
+ done = 1;
+ goto out;
+ }
+ if (__is_root_gfid (local->loc.gfid)) {
+ done = 1;
+ goto out;
+ }
}
ret = marker_trav_parent (local);