Browse code

Handle spam using broken e-mail generators for multipart/alternative

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

Nigel Horne authored on 2004/06/14 18:08:29
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Mon Jun 14 10:07:24 BST 2004 (njh)
2
+----------------------------------
3
+  * libclamav/mbox.c:	Some spam generates very broken headers, added fix
4
+  	to try to scan (with warnings about the assumptions made)
5
+
1 6
 Sun Jun 13 14:26:33 CEST 2004 (tk)
2 7
 ----------------------------------
3 8
   * clamscan: --unace is no longer supported (when invoked on a splitted
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.75  2004/06/14 09:07:10  nigelhorne
21
+ * Handle spam using broken e-mail generators for multipart/alternative
22
+ *
20 23
  * Revision 1.74  2004/06/09 18:18:59  nigelhorne
21 24
  * Find uuencoded viruses in multipart/mixed that have no start of message boundaries
22 25
  *
... ...
@@ -210,7 +213,7 @@
210 210
  * Compilable under SCO; removed duplicate code with message.c
211 211
  *
212 212
  */
213
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.74 2004/06/09 18:18:59 nigelhorne Exp $";
213
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.75 2004/06/14 09:07:10 nigelhorne Exp $";
214 214
 
215 215
 #if HAVE_CONFIG_H
216 216
 #include "clamav-config.h"
... ...
@@ -680,9 +683,6 @@ parseEmailBody(message *messageIn, blob **blobsIn, int nBlobs, text *textIn, con
680 680
 				aText = textCopy(messageGetBody(mainMessage));
681 681
 			break;
682 682
 		case MULTIPART:
683
-
684
-			assert(mimeSubtype[0] != '\0');
685
-
686 683
 			boundary = messageFindArgument(mainMessage, "boundary");
687 684
 
688 685
 			if(boundary == NULL) {
... ...
@@ -696,6 +696,12 @@ parseEmailBody(message *messageIn, blob **blobsIn, int nBlobs, text *textIn, con
696 696
 				break;
697 697
 			}
698 698
 
699
+			if(mimeSubtype[0] == '\0') {
700
+				cli_warnmsg("Multipart has no subtype assuming alternative\n");
701
+				mimeSubtype = "alternative";
702
+				messageSetMimeSubtype(mainMessage, "alternative");
703
+			}
704
+
699 705
 			/*
700 706
 			 * Get to the start of the first message
701 707
 			 */