887953
From b0f153893c9fd4328d51e32be4ecf8d75d5968d5 Mon Sep 17 00:00:00 2001
887953
From: Mohammed Rafi KC <rkavunga@redhat.com>
887953
Date: Fri, 17 May 2019 12:49:59 +0530
887953
Subject: [PATCH 540/540] dht: NULL check before setting error flag
887953
887953
Function dht_common_mark_mdsxattr blindly setting value for
887953
an integer pointer without validating it. In fact there are
887953
two callers of this function that passes NULL value to the
887953
same pointer which leads to a crash.
887953
887953
Backport of : https://review.gluster.org/#/c/22345/
887953
887953
>Change-Id: Id94ffe216f6a21f007b3291bff0b1e1c1989075c
887953
>fixes: bz#1687811
887953
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
887953
887953
Change-Id: I3efb227619bef5f69570763848e09b2784371140
887953
BUG: 1711159
887953
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/170622
887953
Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
---
887953
 xlators/cluster/dht/src/dht-common.c | 3 ++-
887953
 1 file changed, 2 insertions(+), 1 deletion(-)
887953
887953
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
887953
index 12a17e6..e998417 100644
887953
--- a/xlators/cluster/dht/src/dht-common.c
887953
+++ b/xlators/cluster/dht/src/dht-common.c
887953
@@ -890,7 +890,8 @@ dht_common_mark_mdsxattr (call_frame_t *frame, int *errst, int mark_during_fresh
887953
                                 "Failed to get hashed subvol for path %s"
887953
                                 "gfid is %s ",
887953
                                 local->loc.path, gfid_local);
887953
-                        (*errst) = 1;
887953
+                        if (errst)
887953
+                                (*errst) = 1;
887953
                         ret = -1;
887953
                         goto out;
887953
                 }
887953
-- 
887953
1.8.3.1
887953