Adds bounds checking of fd passed into makefd_xprt against FD_SETSIZE.
http://web.mit.edu/kerberos/advisories/MITKRB5-SA-2008-002.txt
This was reported against MIT krb5 code, but it looks like libtirpc
has a similar problem.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
assert(fd != -1);
+ if (fd >= FD_SETSIZE) {
+ warnx("svc_vc: makefd_xprt: fd too high\n");
+ xprt = NULL;
+ goto done;
+ }
+
xprt = mem_alloc(sizeof(SVCXPRT));
if (xprt == NULL) {
warnx("svc_vc: makefd_xprt: out of memory");