From 35efc2f567052c69cfdedaafdf3082104d354bef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Fri, 19 Feb 2010 18:36:55 +0000 Subject: [PATCH] * protect access to client_sock here too. --- citadel/sysdep.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/citadel/sysdep.c b/citadel/sysdep.c index c39d85ba6..416fc7b89 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -1080,8 +1080,11 @@ do_select: force_purge = 0; */ begin_critical_section(S_SESSION_TABLE); for (ptr = ContextList; ptr != NULL; ptr = ptr->next) { - if ( (FD_ISSET(ptr->client_socket, &readfds)) - && (ptr->state == CON_IDLE) ) { + int checkfd = ptr->client_socket; + if ((checkfd != -1) && + (FD_ISSET(checkfd, &readfds)) && + (ptr->state == CON_IDLE) ) + { ptr->input_waiting = 1; if (!bind_me) { bind_me = ptr; /* I choose you! */ -- 2.39.2