Blob Blame History Raw
From a469cad3a6b7f340c6ac6fad7c2186299d675d70 Mon Sep 17 00:00:00 2001
From: Amar Tumballi <amarts@redhat.com>
Date: Mon, 5 Nov 2018 10:22:44 +0530
Subject: [PATCH 415/444] 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.

Upstream:
> URL: https://review.gluster.org/21493

BUG: 1643035
Change-Id: I799d92c8089ddbfd9171da4e7e1d77ac91133aba
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/154845
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
Tested-by: RHGS Build Bot <nigelb@redhat.com>
---
 libglusterfs/src/statedump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index a123adb..a4635f3 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -812,7 +812,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) {
-- 
1.8.3.1