summaryrefslogtreecommitdiffstats
path: root/xlators/debug
diff options
context:
space:
mode:
authorMohammed Azhar Padariyakam <mpadariy@redhat.com>2017-09-21 14:07:16 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-10-03 13:30:11 +0000
commit1c0d3ac5c5f9774a0f25f5282d54177af02f984e (patch)
tree918306ae52276fd67fbd61699cc2263996980a1a /xlators/debug
parentfe5fc91ab9b74b525d4979e09ce13766b3180381 (diff)
xlators/io-stats: Coverity Fix CHECKED_RETURN in resolve_group_name
Issue: Calling "getgrgid_r(gid, &grp, grp_buf, grp_buf_len, &grp_result)" without checking return value. This library function may fail and return an error code Solution: getgrgrid_r returns zero when the operation is successful and a non-zero error code if there's some error in the operation Fix: Checked for the return value and redirected to error if the return value was non-zero Change-Id: I0d082c6d57c6148b9830bc020140946c06d6f800 BUG: 789278 Signed-off-by: Mohammed Azhar Padariyakam <mpadariy@redhat.com>
Diffstat (limited to 'xlators/debug')
-rw-r--r--xlators/debug/io-stats/src/io-stats.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index a46d1160038..9c3ca2d0a69 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -1018,8 +1018,9 @@ _resolve_group_name (xlator_t *this, gid_t gid)
goto err;
}
- getgrgid_r (gid, &grp, grp_buf, grp_buf_len,
- &grp_result);
+ if (getgrgid_r (gid, &grp, grp_buf, grp_buf_len, &grp_result) != 0)
+ goto err;
+
if (!grp_result)
goto err;