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