From a9d04541fd0f0018d196c08b0f0091a19649cb93 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Tue, 12 Mar 2019 18:00:37 +0530 Subject: 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 --- 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 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; } -- cgit