From 1d84821d93e8d31d3be1d81a764449426f8e4a2b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 22 Jun 2010 10:38:47 +0200 Subject: poll: Handle FD_SETSIZE in bsd_poll(). --- libssh/poll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libssh/poll.c b/libssh/poll.c index be3f6281..55147745 100644 --- a/libssh/poll.c +++ b/libssh/poll.c @@ -136,7 +136,7 @@ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { /* compute fd_sets and find largest descriptor */ for (rc = -1, max_fd = 0, i = 0; i < nfds; i++) { - if (fds[i].fd == SSH_INVALID_SOCKET) { + if (fds[i].fd == SSH_INVALID_SOCKET || fds[i].fd >= FD_SETSIZE) { continue; } -- cgit