diff options
author | Prashanth Pai <ppai@redhat.com> | 2015-06-14 16:40:58 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-06-26 03:43:33 -0700 |
commit | 1da4ba883721e1613c4a0685e0fdd177a55eb07e (patch) | |
tree | 6691661392130cb97c44401853f40b2cab2ab8ae /xlators/storage | |
parent | bbde491b47f240836d454585d10c5623aef45662 (diff) |
posix: Fix fgetxattr() crash when key name is NULL
This is used to get the size of xattr list (to later allocate buffer):
glfs_flistxattr(glfd, NULL, 0);
glfs_flistxattr() internally has the following call:
syncop_fgetxattr (subvol, fd, &xattr, NULL, NULL, NULL);
strncmp() segfaults as name is NULL in posix_fgetxattr()
Turns out this was a coverity fix in master branch that was not
backported to 3.7.x tree.
http://review.gluster.org/#/c/10252/
BUG: 1235904
Change-Id: I2ec4715f1ea2f0e9c5314b2dc358bc01ad7b7d45
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/11213
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index a2e484e4f8c..b3856cc91ff 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -4163,7 +4163,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this, goto done; } - if (strncmp (name, GLUSTERFS_GET_OBJECT_SIGNATURE, + if (name && strncmp (name, GLUSTERFS_GET_OBJECT_SIGNATURE, strlen (GLUSTERFS_GET_OBJECT_SIGNATURE)) == 0) { op_ret = posix_fdget_objectsignature (_fd, dict); if (op_ret < 0) { |