From be380f35a2c9c356a8adcb9118e4f77ff9d1fec6 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/6395 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-common.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index f613108dc..110e3eebb 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -2349,6 +2349,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