Prevent infinite loop, when kevent(2) is called wihout eventlist (i.e.
eventlist == NULL or nevents == 0).
This commit is contained in:
parent
ba1e7b8577
commit
c1953cedc9
@ -49,7 +49,7 @@ _kevent(int kq, const struct kevent *changelist, int nchanges,
|
||||
|
||||
rc = __sys_kevent(kq, changelist, nchanges,
|
||||
eventlist, nevents, &nullts);
|
||||
if (rc == 0 && (timeout == NULL ||
|
||||
if (rc == 0 && eventlist != NULL && nevents > 0 && (timeout == NULL ||
|
||||
timeout->tv_sec != 0 || timeout->tv_nsec != 0)) {
|
||||
/* Save the socket file descriptor: */
|
||||
curthread->data.fd.fd = kq;
|
||||
|
Loading…
Reference in New Issue
Block a user