From 272b55b54b3f760f0b95b29ec37ed719852ce4ed Mon Sep 17 00:00:00 2001 From: arao Date: Tue, 17 Feb 2015 15:14:53 +0530 Subject: dht: Fixing dereference after null check CID: 1175023 The check for null is made before dereferencing the pointer variable alongside. Change-Id: I827927f2fcf6d1f365f4d6b5a678373020b9daf9 BUG: 789278 Signed-off-by: arao Reviewed-on: http://review.gluster.org/9663 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: N Balachandran Reviewed-by: Shyamsundar Ranganathan --- xlators/cluster/dht/src/dht-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src') diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index fc281b80287..042adf1714b 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -135,7 +135,7 @@ dht_priv_dump (xlator_t *this) gf_proc_dump_write("refresh_interval", "%d", conf->refresh_interval); gf_proc_dump_write("unhashed_sticky_bit", "%d", conf->unhashed_sticky_bit); - if (conf->du_stats) { + if (conf->du_stats && conf->subvolume_status) { for (i = 0; i < conf->subvolume_cnt; i++) { if (!conf->subvolume_status[i]) continue; -- cgit