Browse code

Bug 366

git-svn: trunk@3037

Nigel Horne authored on 2007/04/24 22:37:55
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Apr 24 13:48:04 BST 2007 (njh)
2
+----------------------------------
3
+  * libclamav/mbox.c:	Bug 366
4
+
1 5
 Sun Apr 22 15:29:23 BST 2007 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Fixed multi-byte char bug under Windows
... ...
@@ -2434,6 +2434,10 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
2434 2434
 							&aText, recursion_level);
2435 2435
 						if((rc == OK_ATTACHMENTS_NOT_SAVED) && (old_rc == OK))
2436 2436
 							rc = OK;
2437
+						if(messages[multiparts]) {
2438
+							messageDestroy(messages[multiparts]);
2439
+							messages[multiparts] = NULL;
2440
+						}
2437 2441
 						--multiparts;
2438 2442
 						if(rc == VIRUS)
2439 2443
 							infected = TRUE;
... ...
@@ -2796,6 +2800,14 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
2796 2796
 			if(!isBounceStart(lineGetData(l)))
2797 2797
 				continue;
2798 2798
 
2799
+			lookahead = t->t_next;
2800
+			if(lookahead) {
2801
+				if(isBounceStart(lineGetData(lookahead->t_line)))
2802
+					/* don't save worthless header lines */
2803
+					continue;
2804
+			} else	/* don't save a single liner */
2805
+				break;
2806
+
2799 2807
 			/*
2800 2808
 			 * We've found what looks like the start of a bounce
2801 2809
 			 * message. Only bother saving if it really is a bounce
... ...
@@ -2803,7 +2815,7 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
2803 2803
 			 * messages that have lots of bounces within bounces in
2804 2804
 			 * them
2805 2805
 			 */
2806
-			for(lookahead = t->t_next; lookahead; lookahead = lookahead->t_next) {
2806
+			for(; lookahead; lookahead = lookahead->t_next) {
2807 2807
 				l = lookahead->t_line;
2808 2808
 
2809 2809
 				if(l == NULL)