libc: initialize fd sets before use in 'poll()'

Fixes #2914
This commit is contained in:
Christian Prochaska 2018-07-10 14:58:17 +02:00 committed by Christian Helmuth
parent b2f7a6a934
commit 526680e977

View File

@ -61,6 +61,11 @@ poll(struct pollfd fds[], nfds_t nfds, int timeout)
}
/* populate event bit vectors for the events we're interested in */
FD_ZERO(&readfds);
FD_ZERO(&writefds);
FD_ZERO(&exceptfds);
for (i = 0; i < nfds; i++) {
fd = fds[i].fd;
if (fd == -1)