From bf5bfa5f2fcd1a73078c289aeac715bd82c366ed Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 25 Oct 2018 19:48:37 +0530 Subject: statedump: fix clang null dereference error ctx->active can be null, and is checked elsewhere in the same function. In another case, where 'ctx->active' gets dereferenced, it needs to be validated before the loop is hit. Updates: bz#1622665 Change-Id: I4ec917e96c0756586fc7a74c76848bb9589a0293 Signed-off-by: Amar Tumballi --- libglusterfs/src/statedump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index 422fb05ede..be928a375d 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -808,7 +808,7 @@ gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx) if (!ctx) goto out; - if (ctx) { + if (ctx && ctx->active) { top = ctx->active->first; for (trav_p = &top->children; *trav_p; trav_p = &(*trav_p)->next) { brick_count++; -- cgit