Browse code

Fix crash when a server can't be contacted

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1046 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/10/30 15:51:28
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sat Oct 30 07:50:33 BST 2004 (njh)
2
+----------------------------------
3
+  * clamav-milter:	Fix possible crash when one or more servers can't be
4
+				contacted
5
+
1 6
 Fri Oct 29 19:11:07 BST 2004 (njh)
2 7
 ----------------------------------
3 8
   * clamav-milter:	Fix problem with deleting X-VIRUS-STATUS not setting
... ...
@@ -539,6 +539,7 @@ Changes
539 539
 			we can't connect to the returned PORT
540 540
 		Fix problem with deleting X-VIRUS-STATUS not setting correct
541 541
 			libmilter settings
542
+0.80n	30/10/04 Fix possible crash when one or more servers can't be contacted
542 543
 
543 544
 INTERNATIONALISATION
544 545
 
... ...
@@ -26,6 +26,9 @@
26 26
  *
27 27
  * Change History:
28 28
  * $Log: clamav-milter.c,v $
29
+ * Revision 1.145  2004/10/30 06:49:08  nigelhorne
30
+ * Fix crash when a server can't be contacted
31
+ *
29 32
  * Revision 1.144  2004/10/29 18:09:14  nigelhorne
30 33
  * Fix X-VIRUS-STATUS deletion
31 34
  *
... ...
@@ -443,9 +446,9 @@
443 443
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
444 444
  * Added -f flag use MaxThreads if --max-children not set
445 445
  */
446
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.144 2004/10/29 18:09:14 nigelhorne Exp $";
446
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.145 2004/10/30 06:49:08 nigelhorne Exp $";
447 447
 
448
-#define	CM_VERSION	"0.80m"
448
+#define	CM_VERSION	"0.80n"
449 449
 
450 450
 /*#define	CONFDIR	"/usr/local/etc"*/
451 451
 
... ...
@@ -1801,7 +1804,7 @@ findServer(void)
1801 1801
 		perror("pthread_cond_broadcast");
1802 1802
 
1803 1803
 	pthread_mutex_lock(&sstatus_mutex);
1804
-	for(; i < max_children; i++)
1804
+	for(i = 0; i < max_children; i++)
1805 1805
 		if(cmdSocketsStatus[i] == CMDSOCKET_FREE) {
1806 1806
 			cmdSocketsStatus[i] = CMDSOCKET_INUSE;
1807 1807
 			pthread_mutex_unlock(&sstatus_mutex);