Add check on num fds

This commit is contained in:
Alfredo Cardigliano 2025-12-03 14:40:17 +01:00
parent d155a0cf6d
commit c1de185d2c

View file

@ -6045,6 +6045,11 @@ int Utils::pollSocket(int sock, int timeout /* msec */) {
fd_set rset;
struct timeval tv;
if (sock > FD_SETSIZE) {
ntop->getTrace()->traceEvent(TRACE_WARNING, "Unable to poll socket %d (too many file descriptors)");
return -1;
}
FD_ZERO(&rset);
FD_SET(sock, &rset);