233933
From 45c9eeb5544738d4d1d0aefb8a7f61e5d8859ad8 Mon Sep 17 00:00:00 2001
233933
From: Mohammed Rafi KC <rkavunga@redhat.com>
233933
Date: Tue, 12 Mar 2019 18:00:37 +0530
233933
Subject: [PATCH 103/124] dht: NULL check before setting error flag
233933
233933
Function dht_common_mark_mdsxattr blindly setting value for
233933
an integer pointer without validating it. In fact there are
233933
two callers of this function that passes NULL value to the
233933
same pointer which leads to a crash.
233933
233933
Backport of : https://review.gluster.org/#/c/22345/
233933
233933
>Change-Id: Id94ffe216f6a21f007b3291bff0b1e1c1989075c
233933
>fixes: bz#1687811
233933
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
233933
233933
Change-Id: Id9785c16184fd80e8184e5ae135fb63bf44692cd
233933
BUG: 1471742
233933
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/167846
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
233933
---
233933
 xlators/cluster/dht/src/dht-common.c | 3 ++-
233933
 1 file changed, 2 insertions(+), 1 deletion(-)
233933
233933
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
233933
index 367548f..2a68193 100644
233933
--- a/xlators/cluster/dht/src/dht-common.c
233933
+++ b/xlators/cluster/dht/src/dht-common.c
233933
@@ -852,7 +852,8 @@ dht_common_mark_mdsxattr(call_frame_t *frame, int *errst,
233933
                    "Failed to get hashed subvol for path %s"
233933
                    "gfid is %s ",
233933
                    local->loc.path, gfid_local);
233933
-            (*errst) = 1;
233933
+            if (errst)
233933
+                (*errst) = 1;
233933
             ret = -1;
233933
             goto out;
233933
         }
233933
-- 
233933
1.8.3.1
233933