From d37ff43e1c4ff34d6674203a4aaa65ebae59cd28 Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Tue, 19 Apr 2011 00:40:45 -0400 Subject: [PATCH] Only check FD_ISSET(sock) if sock is non-zero --- src/bsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) -- 2.30.2