Check for invalid max socket fd before polling

refactor
PgSocks 2 years ago
parent a283cad9ed
commit 638fcd3fe2

@ -59,6 +59,10 @@ connection_new(unsigned int source_port, const char* source_ip, unsigned int des
struct Connection*
connection_poll_ready(struct Client* client) {
// Return a null connection if no sockets have been opened
if(max_fds < 0)
return NULL;
// Add all the connections' socket file descriptors to a watch list
fd_set read_fds;
FD_ZERO(&read_fds);

Loading…
Cancel
Save