diff options
author | sobomax <sobomax@FreeBSD.org> | 2001-12-08 00:53:37 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2001-12-08 00:53:37 +0000 |
commit | c1953cedc9e1ea758b117e8768440fc1056524fb (patch) | |
tree | 622e64637b9610f06ca7c6cba27e005a11f6d997 /lib/libc_r | |
parent | ba1e7b85770ec4a614f79c25d579dcd341018bdd (diff) | |
download | FreeBSD-src-c1953cedc9e1ea758b117e8768440fc1056524fb.zip FreeBSD-src-c1953cedc9e1ea758b117e8768440fc1056524fb.tar.gz |
Prevent infinite loop, when kevent(2) is called wihout eventlist (i.e.
eventlist == NULL or nevents == 0).
Diffstat (limited to 'lib/libc_r')
-rw-r--r-- | lib/libc_r/uthread/uthread_kevent.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/uthread_kevent.c b/lib/libc_r/uthread/uthread_kevent.c index a7dfbf0..17aeaea 100644 --- a/lib/libc_r/uthread/uthread_kevent.c +++ b/lib/libc_r/uthread/uthread_kevent.c @@ -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; |