diff options
author | Arjun Sharma <arjsharm@redhat.com> | 2018-10-15 17:37:36 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-10-21 05:56:22 +0000 |
commit | e1a9c23b83b8d46bf44a7a9952da0c61c8a46c79 (patch) | |
tree | 3bc369bc7eeb18b955c338f5f4fc170020fb4e39 /xlators/protocol/server | |
parent | c5f5ce2a9b1c085209cae21a7e1df5f60bc1a7da (diff) |
protocol/server: added check for positve value in server-handshake.c
This patch fixes CID 1124651
Change-Id: I6f33954f08cfdd7cb4236f9a81ec7980f81d19e7
updates: bz#789278
Signed-off-by: Arjun <arjsharm@redhat.com>
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r-- | xlators/protocol/server/src/server-handshake.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 698c3f8579f..5f6b96792fa 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -929,8 +929,9 @@ fail: GF_ASSERT(rsp); rsp->op_ret = 0; - rsp->dict.dict_len = dict_serialized_length(reply); - if (rsp->dict.dict_len) { + ret = dict_serialized_length(reply); + if (ret > 0) { + rsp->dict.dict_len = ret; rsp->dict.dict_val = GF_CALLOC(1, rsp->dict.dict_len, gf_server_mt_rsp_buf_t); if (rsp->dict.dict_val) { |