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