[PATCH] [patch]libtirpc: check the makefd_xprt return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



xprt may return NULL, so check the return value is necessary.

Signed-off-by: Ditang Chen <ditang.c@xxxxxxxxx>
---
 src/svc_vc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/svc_vc.c b/src/svc_vc.c
index 9824631..f864951 100644
--- a/src/svc_vc.c
+++ b/src/svc_vc.c
@@ -337,6 +337,8 @@ again:
 	 */

 	newxprt = makefd_xprt(sock, r->sendsize, r->recvsize);
+	if (!newxprt)
+		return (FALSE);

 	if (!__rpc_set_netbuf(&newxprt->xp_rtaddr, &addr, len))
 		return (FALSE);
-- 
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux