From: Ari Johnson Date: Tue, 19 Apr 2011 04:40:45 +0000 (-0400) Subject: Only check FD_ISSET(sock) if sock is non-zero X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=d37ff43e1c4ff34d6674203a4aaa65ebae59cd28;p=cobramush.git Only check FD_ISSET(sock) if sock is non-zero --- diff --git a/src/bsd.c b/src/bsd.c index 5a2e470..be82561 100644 --- a/src/bsd.c +++ b/src/bsd.c @@ -1197,7 +1197,7 @@ shovechars(Port_t port __attribute__ ((__unused__)), update_pending_info_slaves(); } - if (FD_ISSET(sock, &input_set)) { + if (sock && FD_ISSET(sock, &input_set)) { if (!info_slave_halted) { addr_len = sizeof(addr); newsock = accept(sock, (struct sockaddr *) &addr, &addr_len); @@ -1230,7 +1230,7 @@ shovechars(Port_t port __attribute__ ((__unused__)), } #endif #else /* INFO_SLAVE */ - if (FD_ISSET(sock, &input_set)) + if (sock && FD_ISSET(sock, &input_set)) setup_desc(sock, false); #ifdef HAS_OPENSSL if (sslsock && FD_ISSET(sslsock, &input_set))