Commit b599dd68 authored by Marek Vavrusa's avatar Marek Vavrusa

Fixed potential read errors on fdset iterations.

parent 512aa256
......@@ -173,7 +173,7 @@ int fdset_epoll_next(fdset_t *fdset, fdset_it_t *it)
}
/* Check boundaries. */
if (it->pos >= fdset->polled) {
if (it->pos >= fdset->polled || it->pos >= fdset->nfds) {
return -1;
}
......
......@@ -226,7 +226,7 @@ int fdset_kqueue_next(fdset_t *fdset, fdset_it_t *it)
}
/* Check boundaries. */
if (it->pos >= fdset->polled) {
if (it->pos >= fdset->polled || it->pos >= fdset->nfds) {
return -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment