summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/bsd-poll.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2021-11-19 08:53:46 +0100
committerDarren Tucker <dtucker@dtucker.net>2021-11-19 08:54:34 +0100
commitb7ffbb17e37f59249c31f1ff59d6c5d80888f689 (patch)
tree6ea8cbff889fdb0a2ac6a4fb288ff62752460b91 /openbsd-compat/bsd-poll.c
parentDon't auto-enable Capsicum sandbox on FreeBSD 9/10. (diff)
downloadopenssh-b7ffbb17e37f59249c31f1ff59d6c5d80888f689.tar.xz
openssh-b7ffbb17e37f59249c31f1ff59d6c5d80888f689.zip
Allow for fd = -1 in compat ppoll overflow check.
Fixes tests on at least FreeBSD 6, possibly others.
Diffstat (limited to '')
-rw-r--r--openbsd-compat/bsd-poll.c2
1 files changed, 1 insertions, 1 deletions
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;
}