From: Darren Tucker Date: Fri, 19 Nov 2021 07:53:46 +0000 (+1100) Subject: Allow for fd = -1 in compat ppoll overflow check. X-Git-Tag: V_8_9_P1~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7ffbb17e37f59249c31f1ff59d6c5d80888f689;p=thirdparty%2Fopenssh-portable.git Allow for fd = -1 in compat ppoll overflow check. Fixes tests on at least FreeBSD 6, possibly others. --- diff --git a/openbsd-compat/bsd-poll.c b/openbsd-compat/bsd-poll.c index b661c030e..faef8343b 100644 --- a/openbsd-compat/bsd-poll.c +++ b/openbsd-compat/bsd-poll.c @@ -50,7 +50,7 @@ ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *tmoutp, for (i = 0; i < nfds; i++) { fd = fds[i].fd; - if (fd >= FD_SETSIZE) { + if (fd != -1 && fd >= FD_SETSIZE) { errno = EINVAL; return -1; }