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