summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-11-27 10:35:30 -0800
committerVijay Bellur <vbellur@redhat.com>2013-12-04 03:33:46 -0800
commit0f02c5125b96da8083a623ed9f455e68ded46b9c (patch)
tree972ee0bae78c7c6bf592b78dbb64fb8f37052fff
parentc23f35f7ad28b03b3ce5a530c7453bc9f5b7bc05 (diff)
cluster/afr: handle NULL check before strlen/strcmp in fgetxattr
xattr name can legally be NULL. Handle that case without crashing. Change-Id: Ie214cb05ccd52565dc247a9234ad83ae799d3866 BUG: 1036879 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6420 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index c798e19..c476dd7 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -1330,7 +1330,7 @@ afr_is_special_xattr (const char *name, fop_getxattr_cbk_t *cbk,
gf_boolean_t is_spl = _gf_true;
GF_ASSERT (cbk);
- if (!cbk) {
+ if (!cbk || !name) {
is_spl = _gf_false;
goto out;
}