summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2017-11-03 15:59:00 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-11-05 04:11:37 +0000
commit1160ded99bf5fcd00bd0230dfc41336af1efbe6b (patch)
tree4d38eb00ce6f23af16a98502c81f6d2d2abf4f40 /xlators/cluster/ec
parent0dcd5b2feeeec7c29bd2454d6ad950d094d02b0f (diff)
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 <aspandey@redhat.com>
Diffstat (limited to 'xlators/cluster/ec')
-rw-r--r--xlators/cluster/ec/src/ec-common.c2
1 files changed, 1 insertions, 1 deletions
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;