Skip to content

Commit

Permalink
Allow for fd = -1 in compat ppoll overflow check.
Browse files Browse the repository at this point in the history
Fixes tests on at least FreeBSD 6, possibly others.
  • Loading branch information
daztucker committed Nov 19, 2021
1 parent 04b172d commit b7ffbb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openbsd-compat/bsd-poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b7ffbb1

Please sign in to comment.