887953
From a469cad3a6b7f340c6ac6fad7c2186299d675d70 Mon Sep 17 00:00:00 2001
887953
From: Amar Tumballi <amarts@redhat.com>
887953
Date: Mon, 5 Nov 2018 10:22:44 +0530
887953
Subject: [PATCH 415/444] statedump: fix clang null dereference error
887953
887953
ctx->active can be null, and is checked elsewhere in the
887953
same function. In another case, where 'ctx->active' gets
887953
dereferenced, it needs to be validated before the loop
887953
is hit.
887953
887953
Upstream:
887953
> URL: https://review.gluster.org/21493
887953
887953
BUG: 1643035
887953
Change-Id: I799d92c8089ddbfd9171da4e7e1d77ac91133aba
887953
Signed-off-by: Amar Tumballi <amarts@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/154845
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
---
887953
 libglusterfs/src/statedump.c | 2 +-
887953
 1 file changed, 1 insertion(+), 1 deletion(-)
887953
887953
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
887953
index a123adb..a4635f3 100644
887953
--- a/libglusterfs/src/statedump.c
887953
+++ b/libglusterfs/src/statedump.c
887953
@@ -812,7 +812,7 @@ gf_proc_dump_info (int signum, glusterfs_ctx_t *ctx)
887953
         if (!ctx)
887953
                 goto out;
887953
 
887953
-        if (ctx) {
887953
+        if (ctx && ctx->active) {
887953
                 top = ctx->active->first;
887953
                 for (trav_p = &top->children; *trav_p;
887953
                                      trav_p = &(*trav_p)->next) {
887953
-- 
887953
1.8.3.1
887953