summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2019-03-12 18:00:37 +0530
committerMohammed Rafi KC <rkavunga@redhat.com>2019-03-12 18:11:39 +0530
commita9d04541fd0f0018d196c08b0f0091a19649cb93 (patch)
tree5ddad802cbeb6c1d6ccc230e61fcc56e5f7a398e /xlators/cluster/dht/src
parent66986594a9023c49e61b32769b7e6b260b600626 (diff)
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. Change-Id: Id94ffe216f6a21f007b3291bff0b1e1c1989075c fixes: bz#1687811 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r--xlators/cluster/dht/src/dht-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 367548f5b38..2a68193f7b4 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;
}