summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-11-26 13:30:46 -0800
committerVijay Bellur <vbellur@redhat.com>2013-12-03 02:23:18 -0800
commit49968ca95cbcc9b2b359582a5c6b382f3a8b0958 (patch)
treea4898ad927d96bd72f7715528c74dc4427ae1356 /xlators
parentec60ca1061574f7c28a5ec226fb2553d2a0c8326 (diff)
cluster/dht: handle NULL check before strlen/strcmp in fgetxattr
@key can legally be NULL. Handle that case without crashing. Change-Id: Iaae293caa7eeb24afc9cd2580799173e2ce00911 BUG: 1036879 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6402 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 6b662c67bc4..171aba4a611 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2352,6 +2352,7 @@ dht_fgetxattr (call_frame_t *frame, xlator_t *this,
}
if ((fd->inode->ia_type == IA_IFDIR)
+ && key
&& (strncmp (key, GF_XATTR_LOCKINFO_KEY,
strlen (GF_XATTR_LOCKINFO_KEY) != 0))) {
cnt = local->call_cnt = layout->cnt;