Browse code

better handling of broken files

git-svn: trunk@1017

Tomasz Kojm authored on 2004/10/17 22:36:42
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sun Oct 17 15:31:59 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav/chmunpack.c: better handling of broken files (problem reported
4
+			   by Tomasz Papszun)
5
+
1 6
 Sun Oct 17 10:30:36 BST 2004 (njh)
2 7
 ----------------------------------
3 8
   * libclamav:		Added advice to report mails that can't be scanned
... ...
@@ -536,7 +536,7 @@ static int read_chunk(int fd, off_t offset, uint32_t chunk_len,
536 536
 	chunk_header_t *chunk_hdr;
537 537
 	int retval = FALSE;
538 538
 	
539
-	if (chunk_len < 8) {
539
+	if (chunk_len < 8 || chunk_len > 33554432) {
540 540
 		return FALSE;
541 541
 	}
542 542