qpoll: disallow file descriptors bigger than FD_SETSIZE
I don't know which platforms qpoll.cpp is still used and if in those there's even a way to increase the file descriptor limit above FD_SETSIZE's. But this is an easy change and protects against buffer overruns. Pick-to: 6.4 Change-Id: I810d70e579eb4e2c8e45fffd1718ca1aac8e6bef Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
f003e25258
commit
8c1776ee07
|
|
@ -156,6 +156,11 @@ int qt_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
|
|||
if (fds[i].fd < 0)
|
||||
continue;
|
||||
|
||||
if (fds[i].fd > FD_SETSIZE) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fds[i].events & QT_POLL_EVENTS_MASK)
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue