glusterfs/0103-dht-NULL-check-before-setting-error-flag.patch
Milind Changire 9e3a39e72d autobuild v6.0-2
Resolves: bz#1471742 bz#1652461 bz#1671862 bz#1676495 bz#1691620
Resolves: bz#1696334 bz#1696903 bz#1697820 bz#1698436 bz#1698728
Resolves: bz#1699709 bz#1699835 bz#1702240
Signed-off-by: Milind Changire <mchangir@redhat.com>
2019-04-25 07:10:53 -04:00

44 lines
1.5 KiB
Diff

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