summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorShwetha Acharya <sacharya@redhat.com>2018-11-15 15:24:22 +0530
committerShwetha Acharya <sacharya@redhat.com>2018-11-20 17:29:31 +0530
commitada43dc22d158dcc8998bb35497f885951b52159 (patch)
tree029d8f254cd0fc8b7ededb97a3dc3159052f8497 /xlators/protocol
parent650b5c5271abeb0eef59ac1ebb0ea3c8c37023ab (diff)
protocol/client: unchecked return value
Problem: In client_process_response_v2, value returned from function client_post_common_dict is not checked for errors before being used. Solution: Added a check condition to resolve the issue. CID: 1390020 Change-Id: I4d297f33c8dd332ae5f6f21667a4871133b2b570 updates: bz#789278 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-helpers.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c
index e81f166..c70159f 100644
--- a/xlators/protocol/client/src/client-helpers.c
+++ b/xlators/protocol/client/src/client-helpers.c
@@ -2889,7 +2889,11 @@ client_process_response_v2(call_frame_t *frame, xlator_t *this,
gfx_common_dict_rsp *tmp_rsp = NULL;
tmp_rsp = &this_rsp->compound_rsp_v2_u.compound_getxattr_rsp;
- client_post_common_dict(this, tmp_rsp, &xattr, &xdata);
+ ret = client_post_common_dict(this, tmp_rsp, &xattr, &xdata);
+ if (ret) {
+ tmp_rsp->op_errno = -ret;
+ goto out;
+ }
CLIENT4_POST_FOP_TYPE(getxattr, common_dict, this_rsp,
this_args_cbk, xattr, xdata);
@@ -3004,6 +3008,7 @@ client_process_response_v2(call_frame_t *frame, xlator_t *this,
return -ENOTSUP;
}
+out:
if (xdata)
dict_unref(xdata);
if (xattr)