Browse code

Plug memory leak with large number of attachments

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

Nigel Horne authored on 2004/06/25 06:39:43
Showing 2 changed files
... ...
@@ -1,3 +1,9 @@
1
+Thu Jun 24 22:38:16 BST 2004 (njh)
2
+----------------------------------
3
+  * libclamav:	Plug small memory leak when scanning emails with a large
4
+  	number of attachments
5
+		Handle uuencoded files created with buggy software
6
+
1 7
 Thu Jun 24 09:09:27 BST 2004 (trog)
2 8
 -----------------------------------
3 9
   * libclamav ole2_extract.[ch],scanners.c: proper file accounting (original patch
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.81  2004/06/24 21:36:38  nigelhorne
21
+ * Plug memory leak with large number of attachments
22
+ *
20 23
  * Revision 1.80  2004/06/23 16:23:25  nigelhorne
21 24
  * Further empty line optimisation
22 25
  *
... ...
@@ -228,7 +231,7 @@
228 228
  * Compilable under SCO; removed duplicate code with message.c
229 229
  *
230 230
  */
231
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.80 2004/06/23 16:23:25 nigelhorne Exp $";
231
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.81 2004/06/24 21:36:38 nigelhorne Exp $";
232 232
 
233 233
 #if HAVE_CONFIG_H
234 234
 #include "clamav-config.h"
... ...
@@ -711,7 +714,7 @@ parseEmailBody(message *messageIn, blob **blobsIn, int nBlobs, text *textIn, con
711 711
 	/* Pre-assertions */
712 712
 	if(nBlobs >= MAX_ATTACHMENTS) {
713 713
 		cli_warnmsg("Not all attachments will be scanned\n");
714
-		return 2;
714
+		/*return 2;*/
715 715
 	}
716 716
 
717 717
 	aText = textIn;
... ...
@@ -1347,6 +1350,7 @@ parseEmailBody(message *messageIn, blob **blobsIn, int nBlobs, text *textIn, con
1347 1347
 							blobGetFilename(blobs[i]),
1348 1348
 							blobGetFilename(blobList[j]));
1349 1349
 						blobDestroy(blobs[i]);
1350
+						blobs[i] = NULL;
1350 1351
 					}
1351 1352
 				}
1352 1353