Browse code

Scan multipart alternatives that have no boundaries, finds some uuencoded happy99

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

Nigel Horne authored on 2003/11/21 16:28:39
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Fri Nov 21 12:58:02 IST 2003 (njh)
2
+---------------------------------
3
+  * libclamav:	Scan multipart alternatives that have no boundaries, finds some
4
+  		uuencoded happy99
5
+
1 6
 Wed Nov 19 16:34:04 GMT 2003 (njh)
2 7
 ---------------------------------
3 8
   * clamav-milter: Close cmdSocket earlier
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.19  2003/11/21 07:26:31  nigelhorne
21
+ * Scan multipart alternatives that have no boundaries, finds some uuencoded happy99
22
+ *
20 23
  * Revision 1.18  2003/11/17 08:13:21  nigelhorne
21 24
  * Handle spaces at the end of lines of MIME headers
22 25
  *
... ...
@@ -45,7 +48,7 @@
45 45
  * Compilable under SCO; removed duplicate code with message.c
46 46
  *
47 47
  */
48
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.18 2003/11/17 08:13:21 nigelhorne Exp $";
48
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.19 2003/11/21 07:26:31 nigelhorne Exp $";
49 49
 
50 50
 #ifndef	CL_DEBUG
51 51
 /*#define	NDEBUG	/* map CLAMAV debug onto standard */
... ...
@@ -489,10 +492,15 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
489 489
 
490 490
 			if(boundary == NULL) {
491 491
 				cli_warnmsg("Multipart MIME message contains no boundaries\n");
492
-				return 2;	/* Broken e-mail message */
492
+				/* Broken e-mail message */
493
+				mimeType = NOMIME;
494
+				/*
495
+				 * The break means that we will still
496
+				 * check if the file contains a uuencoded file
497
+				 */
498
+				break;
493 499
 			}
494 500
 
495
-
496 501
 			/*
497 502
 			 * Get to the start of the first message
498 503
 			 */
... ...
@@ -507,7 +515,12 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
507 507
 				 * <Thomas.Lamy@in-online.net>
508 508
 				 */
509 509
 				free((char *)boundary);
510
-				return 2;	/* Nothing to do */
510
+				mimeType = NOMIME;
511
+				/*
512
+				 * The break means that we will still
513
+				 * check if the file contains a uuencoded file
514
+				 */
515
+				break;
511 516
 			}
512 517
 			/*
513 518
 			 * Build up a table of all of the parts of this
... ...
@@ -1097,9 +1110,7 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
1097 1097
 		}
1098 1098
 	}
1099 1099
 
1100
-#ifdef	CL_DEBUG
1101 1100
 	cli_dbgmsg("%d attachments found\n", nBlobs);
1102
-#endif
1103 1101
 
1104 1102
 	if(nBlobs == 0) {
1105 1103
 		blob *b;
... ...
@@ -1134,6 +1145,8 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
1134 1134
 			const text *t_line = uuencodeBegin(mainMessage);
1135 1135
 
1136 1136
 			if(t_line != NULL) {
1137
+				cli_dbgmsg("Found uuencoded file\n");
1138
+
1137 1139
 				/*
1138 1140
 				 * Main part contains uuencoded section
1139 1141
 				 */
... ...
@@ -1148,6 +1161,8 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
1148 1148
 					blobDestroy(b);
1149 1149
 				}
1150 1150
 			} else {
1151
+				cli_dbgmsg("Not found uuencoded file\n");
1152
+
1151 1153
 				messageAddArgument(mainMessage, "filename=textportion");
1152 1154
 				if((b = messageToBlob(mainMessage)) != NULL) {
1153 1155
 					/*