summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authornik-redhat <nladha@redhat.com>2020-07-03 17:18:33 +0530
committerRavishankar N <ravishankar@redhat.com>2020-07-08 05:28:05 +0000
commit24ea814fe7d5a5d27fa051d20ab85bc18c051bdc (patch)
tree3cdf25d04bbacf9ed97083b4afe8b6659765e1ee /xlators/cluster/afr/src/afr-self-heal-common.c
parent0a2de3f7f9aafadf0b20197eae2be96275271b97 (diff)
afr: null dereference & nagative value
Added a check for NULL before dereferencing the object as it may be NULL in few cases inside the funtion. Also, added a check for the negative value of gfid_idx. CID: 1430140 CID: 1430145 Change-Id: Ib7d23459b48bbc471dbcccab6d20572261882d11 Updates: #1060 Signed-off-by: nik-redhat <nladha@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 998e9045b97..f35c41df274 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -140,7 +140,7 @@ heal:
}
}
out:
- if (gfid_idx && (*gfid_idx == -1) && (ret == 0)) {
+ if (gfid_idx && (*gfid_idx == -1) && (ret == 0) && local) {
ret = -afr_final_errno(local, priv);
}
loc_wipe(&loc);