Browse code

Multipart headers: handle end of header lines that are not empty

git-svn: trunk@1770

Nigel Horne authored on 2005/11/23 20:21:45
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Nov 23 11:20:54 GMT 2005 (njh)
2
+----------------------------------
3
+  * libclamav/mbox.c:	Multipart headers: handle end of header lines that are
4
+				not empty
5
+
1 6
 Tue Nov 22 12:45:35 CET 2005 (tk)
2 7
 ---------------------------------
3 8
   * libclamav/zziplib/zzip-zip.c: enable pointer fix on TARGET_CPU_SPARC, too
... ...
@@ -15,7 +15,7 @@
15 15
  *  along with this program; if not, write to the Free Software
16 16
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
  */
18
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.261 2005/10/31 21:21:13 nigelhorne Exp $";
18
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.262 2005/11/23 11:19:40 nigelhorne Exp $";
19 19
 
20 20
 #if HAVE_CONFIG_H
21 21
 #include "clamav-config.h"
... ...
@@ -1828,6 +1828,19 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t
1828 1828
 							if(!isspace(data[0]))
1829 1829
 								break;
1830 1830
 
1831
+							if(data[1] == '\0') {
1832
+								/*
1833
+								 * Broken message: the
1834
+								 * blank line at the end
1835
+								 * of the headers isn't blank -
1836
+								 * it contains a space
1837
+								 */
1838
+								cli_dbgmsg("Multipart %d: headers not terminated by blank line\n",
1839
+									multiparts);
1840
+								inhead = FALSE;
1841
+								break;
1842
+							}
1843
+
1831 1844
 							ptr = cli_realloc(fullline,
1832 1845
 								strlen(fullline) + strlen(data) + 1);
1833 1846