From 1160ded99bf5fcd00bd0230dfc41336af1efbe6b Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Fri, 3 Nov 2017 15:59:00 +0530 Subject: cluster/ec: Remove possibility of NULL deref Coverity ID: 237 Problem: In ec_check_status we are trying to deref fop->answer which could be NULL. Solution: Check Null condition before using this pointer. Change-Id: I4f9a73dc2f062ca9c62b4c4baf0a6fcadade88f2 BUG: 789278 Signed-off-by: Ashish Pandey --- xlators/cluster/ec/src/ec-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/cluster/ec/src/ec-common.c') diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c index 6a15223e0cc..ea5773c9879 100644 --- a/xlators/cluster/ec/src/ec-common.c +++ b/xlators/cluster/ec/src/ec-common.c @@ -180,7 +180,7 @@ void ec_check_status(ec_fop_data_t * fop) return; } - if (fop->answer->op_ret >= 0) { + if (fop->answer && fop->answer->op_ret >= 0) { if ((fop->id == GF_FOP_LOOKUP) || (fop->id == GF_FOP_STAT) || (fop->id == GF_FOP_FSTAT)) { partial = fop->answer->iatt[0].ia_type == IA_IFDIR; -- cgit