This code has been broken for ~ 20 years!

Initialise the 'fromlen' parameter for recvfrom() prior to the call, instead
of passing in a 'random' value off the stack.
This should fix the problems with ypbind on current.
I suspect the old kernel was not objecting to -ve buffer lengths.
This commit is contained in:
dsl 2007-08-27 19:51:50 +00:00
parent 28ba522d98
commit 3d3a92a528

View File

@ -1,4 +1,4 @@
/* $NetBSD: rpcb_svc_com.c,v 1.12 2007/05/16 14:42:07 christos Exp $ */
/* $NetBSD: rpcb_svc_com.c,v 1.13 2007/08/27 19:51:50 dsl Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -1217,6 +1217,7 @@ handle_reply(int fd, SVCXPRT *xprt)
goto done;
do {
fromlen = sizeof ss;
inlen = recvfrom(fd, buffer, RPC_BUF_MAX, 0,
(struct sockaddr *)&ss, &fromlen);
} while (inlen < 0 && errno == EINTR);