From f7d6d8579c4f741744a781d338850835765ed171 Mon Sep 17 00:00:00 2001 From: Zhang Huan Date: Fri, 25 Aug 2017 15:15:46 +0800 Subject: 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 --- rpc/rpc-lib/src/xdr-rpcclnt.c | 1 - 1 file changed, 1 deletion(-) (limited to 'rpc/rpc-lib/src') 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) { -- cgit