From 49968ca95cbcc9b2b359582a5c6b382f3a8b0958 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Tue, 26 Nov 2013 13:30:46 -0800 Subject: 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 Reviewed-on: http://review.gluster.org/6402 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-common.c | 1 + 1 file changed, 1 insertion(+) 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; -- cgit