From 7e27cb2352b4f48935e85e3288a24ac03c3d1f83 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Fri, 2 Jan 2015 12:28:12 +0530 Subject: features/uss: Perform NULL check on @name in svc_getxattr LISTXATTR fop is internally converted into a GETXATTR with the "name" parameter set to NULL. In svc_getxattr(), a listxattr was causing a crash because of a NULL pointer dereference on @name. FIX: Add the necessary NULL check. Change-Id: I70024d40dc0695648c6d41b423c2665d030e1232 BUG: 1178079 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/9378 Reviewed-by: Raghavendra Bhat Reviewed-by: Vijaikumar Mallikarjuna Reviewed-by: Sachin Pandit Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/snapview-client/src/snapview-client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index ad505633217..58f566ef520 100644 --- a/xlators/features/snapview-client/src/snapview-client.c +++ b/xlators/features/snapview-client/src/snapview-client.c @@ -791,6 +791,9 @@ svc_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, * If the name variable matches this key then we have * to send back .snaps as the real filename. */ + if (!name) + goto stack_wind; + sscanf (name, "%[^:]:%[^@]", attrname, attrval); strcat (attrname, ":"); @@ -818,7 +821,7 @@ svc_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, goto out; } } - +stack_wind: SVC_GET_SUBVOL_FROM_CTX (this, op_ret, op_errno, inode_type, ret, loc->inode, subvolume, out); -- cgit