From 41bd7281a5fe4062fabe963d7862117aca50cc3d Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 16 Apr 2012 13:26:40 +0530 Subject: 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 BUG: 812767 Reviewed-on: http://review.gluster.com/3154 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- xlators/features/marker/src/marker.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'xlators') 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); -- cgit