From f2a236033700bc4357ee5f67d438204c8405bb08 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Sat, 30 Oct 2004 06:51:28 +0000 Subject: [PATCH] Fix crash when a server can't be contacted git-svn: trunk@1046 --- clamav-devel/ChangeLog | 5 +++++ clamav-devel/clamav-milter/INSTALL | 1 + clamav-devel/clamav-milter/clamav-milter.c | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/clamav-devel/ChangeLog b/clamav-devel/ChangeLog index db6afefc6..69cb1334b 100644 --- a/clamav-devel/ChangeLog +++ b/clamav-devel/ChangeLog @@ -1,3 +1,8 @@ +Sat Oct 30 07:50:33 BST 2004 (njh) +---------------------------------- + * clamav-milter: Fix possible crash when one or more servers can't be + contacted + Fri Oct 29 19:11:07 BST 2004 (njh) ---------------------------------- * clamav-milter: Fix problem with deleting X-VIRUS-STATUS not setting diff --git a/clamav-devel/clamav-milter/INSTALL b/clamav-devel/clamav-milter/INSTALL index e067c8bce..82f3a8c31 100644 --- a/clamav-devel/clamav-milter/INSTALL +++ b/clamav-devel/clamav-milter/INSTALL @@ -539,6 +539,7 @@ Changes we can't connect to the returned PORT Fix problem with deleting X-VIRUS-STATUS not setting correct libmilter settings +0.80n 30/10/04 Fix possible crash when one or more servers can't be contacted INTERNATIONALISATION diff --git a/clamav-devel/clamav-milter/clamav-milter.c b/clamav-devel/clamav-milter/clamav-milter.c index e50c471ae..8f0e6ba4a 100644 --- a/clamav-devel/clamav-milter/clamav-milter.c +++ b/clamav-devel/clamav-milter/clamav-milter.c @@ -26,6 +26,9 @@ * * Change History: * $Log: clamav-milter.c,v $ + * Revision 1.145 2004/10/30 06:49:08 nigelhorne + * Fix crash when a server can't be contacted + * * Revision 1.144 2004/10/29 18:09:14 nigelhorne * Fix X-VIRUS-STATUS deletion * @@ -443,9 +446,9 @@ * Revision 1.6 2003/09/28 16:37:23 nigelhorne * Added -f flag use MaxThreads if --max-children not set */ -static char const rcsid[] = "$Id: clamav-milter.c,v 1.144 2004/10/29 18:09:14 nigelhorne Exp $"; +static char const rcsid[] = "$Id: clamav-milter.c,v 1.145 2004/10/30 06:49:08 nigelhorne Exp $"; -#define CM_VERSION "0.80m" +#define CM_VERSION "0.80n" /*#define CONFDIR "/usr/local/etc"*/ @@ -1801,7 +1804,7 @@ findServer(void) perror("pthread_cond_broadcast"); pthread_mutex_lock(&sstatus_mutex); - for(; i < max_children; i++) + for(i = 0; i < max_children; i++) if(cmdSocketsStatus[i] == CMDSOCKET_FREE) { cmdSocketsStatus[i] = CMDSOCKET_INUSE; pthread_mutex_unlock(&sstatus_mutex);