summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-06-22 10:38:47 +0200
committerAndreas Schneider <asn@cynapses.org>2010-06-22 14:44:54 +0200
commita2a98fb5bc1462d2338c5c2dbe799d8e72d23630 (patch)
tree459a9434610115d14cff5483e40db92f5c10f34d
parente2480fbaba44a1ffb4006ff3f56512a98d8219c3 (diff)
poll: Handle FD_SETSIZE in bsd_poll().
-rw-r--r--libssh/poll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libssh/poll.c b/libssh/poll.c
index 8aeebb42..1837d25e 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -111,7 +111,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;
}