summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Huan <zhanghuan@open-fs.com>2017-08-25 15:15:46 +0800
committerAmar Tumballi <amarts@redhat.com>2018-03-28 07:37:34 +0000
commitf7d6d8579c4f741744a781d338850835765ed171 (patch)
treecc8c751ede22c02e8b78058750067c8d4f365015
parenta60fc2ddc03134fb23c5ed5c0bcb195e1649416b (diff)
rpc: fix incorrect return value when xdr decode fails
xdr_replymsg is called to decode reply message, and it returns failure if the message is corrupted. However, retrieving return value from the global errno is 0 even xdr_replymsg fails. Fix this issue by simply returning a negative value if call to xdr_replymsg fails. Change-Id: I2b9a1dc97652fbb6cf6568ea617f120713784a55 BUG: 1523122 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
-rw-r--r--rpc/rpc-lib/src/xdr-rpcclnt.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/xdr-rpcclnt.c b/rpc/rpc-lib/src/xdr-rpcclnt.c
index 4a6d2ea9131..5b470442d71 100644
--- a/rpc/rpc-lib/src/xdr-rpcclnt.c
+++ b/rpc/rpc-lib/src/xdr-rpcclnt.c
@@ -44,7 +44,6 @@ xdr_to_rpc_reply (char *msgbuf, size_t len, struct rpc_msg *reply,
xdrmem_create (&xdr, msgbuf, len, XDR_DECODE);
if (!xdr_replymsg (&xdr, reply)) {
gf_log ("rpc", GF_LOG_WARNING, "failed to decode reply msg");
- ret = -errno;
goto out;
}
if (payload) {