Browse code

Fix crash if %h is used in a template and --headers is not set

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

Nigel Horne authored on 2004/10/03 02:54:07
Showing 3 changed files
... ...
@@ -1,3 +1,9 @@
1
+Sat Oct  2 18:52:32 BST 2004 (njh)
2
+----------------------------------
3
+  * clamav-milter:	Fix crash if %h is used in a template and --headers is
4
+				not set reported by "Sergey Y. Afonin"
5
+				<asy@kraft-s.ru>
6
+
1 7
 Sat Oct  2 16:41:02 BST 2004 (njh)
2 8
 ----------------------------------
3 9
   * libclamav/table.c:	Fix compilation problem when --enable-debug is not set
... ...
@@ -511,6 +511,7 @@ Changes
511 511
 			an operating system that doesn't support it
512 512
 0.80e	30/9/04	If you say --from with no arguments, the from address is now
513 513
 			set to the orginator's address
514
+0.80f	2/10/04	Fix crash if %h is used in a template and --headers is not set
514 515
 
515 516
 INTERNATIONALISATION
516 517
 
... ...
@@ -26,6 +26,9 @@
26 26
  *
27 27
  * Change History:
28 28
  * $Log: clamav-milter.c,v $
29
+ * Revision 1.137  2004/10/02 17:54:06  nigelhorne
30
+ * Fix crash if %h is used in a template and --headers is not set
31
+ *
29 32
  * Revision 1.136  2004/09/30 19:18:30  nigelhorne
30 33
  * Allow --from with no e-mail address
31 34
  *
... ...
@@ -419,9 +422,9 @@
419 419
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
420 420
  * Added -f flag use MaxThreads if --max-children not set
421 421
  */
422
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.136 2004/09/30 19:18:30 nigelhorne Exp $";
422
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.137 2004/10/02 17:54:06 nigelhorne Exp $";
423 423
 
424
-#define	CM_VERSION	"0.80e"
424
+#define	CM_VERSION	"0.80f"
425 425
 
426 426
 /*#define	CONFDIR	"/usr/local/etc"*/
427 427
 
... ...
@@ -3205,10 +3208,13 @@ header_list_add(header_list_t list, const char *headerf, const char *headerv)
3205 3205
 }
3206 3206
 
3207 3207
 static void
3208
-header_list_print(header_list_t list, FILE *fp)
3208
+header_list_print(const header_list_t list, FILE *fp)
3209 3209
 {
3210 3210
 	const struct header_node_t *iter;
3211 3211
 
3212
+	if(list == NULL)
3213
+		return;
3214
+
3212 3215
 	for(iter = list->first; iter; iter = iter->next) {
3213 3216
 		if(strncmp(iter->header, "From ", 5) == 0)
3214 3217
 			putc('>', fp);