Added safety check for poll(): the nsysnet fd must fit in nsysnet_fd_set.

This commit is contained in:
Daniel K. O. (dkosmari) 2025-10-06 12:52:38 -03:00
parent 055b968da7
commit fa61982981

View File

@ -32,6 +32,10 @@ poll(struct pollfd *fds,
if ((cnv_fd + 1) > cnv_nfds) {
cnv_nfds = cnv_fd + 1;
if (cnv_nfds > NSYSNET_FD_SETSIZE) {
errno = EINVAL;
return -1;
}
}
if (fds[i].events & POLLIN) {