summaryrefslogtreecommitdiffstats
path: root/xlators/features/snapview-client/src
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-01-02 12:28:12 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-01-08 21:00:40 -0800
commit0664e74d86db2fd9a476241fdeacce840897d111 (patch)
tree78aea439aa3a6a8e0786371c9ec49392c260c4ff /xlators/features/snapview-client/src
parent419015d5f61c9d9dcd93f9dda3f7b66f735ded83 (diff)
features/uss: Perform NULL check on @name in svc_getxattr
Backport of: http://review.gluster.org/9378 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: Ifb4ca2a45ecc78c384e92822403eaf2f1b573798 BUG: 1180070 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9417 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features/snapview-client/src')
-rw-r--r--xlators/features/snapview-client/src/snapview-client.c5
1 files changed, 4 insertions, 1 deletions
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);