Browse code

Handle broken RFC2047 headers

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

Nigel Horne authored on 2005/01/09 20:40:01
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Jan  9 11:38:39 GMT 2005 (njh)
2
+----------------------------------
3
+  * liclamav/mbox.c:	Add support for messages that break RFC2047
4
+
1 5
 Sat Jan  8 03:50:51 CET 2005 (tk)
2 6
 ---------------------------------
3 7
   * aclocal.m4/configure: Add support for x86_64 (patch by Gwenole Beauchesne
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.209  2005/01/09 11:37:02  nigelhorne
21
+ * Handle broken RFC2047 headers
22
+ *
20 23
  * Revision 1.208  2005/01/07 13:48:46  nigelhorne
21 24
  * Save content-type: application only once
22 25
  *
... ...
@@ -612,7 +615,7 @@
612 612
  * Compilable under SCO; removed duplicate code with message.c
613 613
  *
614 614
  */
615
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.208 2005/01/07 13:48:46 nigelhorne Exp $";
615
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.209 2005/01/09 11:37:02 nigelhorne Exp $";
616 616
 
617 617
 #if HAVE_CONFIG_H
618 618
 #include "clamav-config.h"
... ...
@@ -1784,7 +1787,8 @@ parseEmailHeader(message *m, const char *line, const table_t *rfc821)
1784 1784
 
1785 1785
 	copy = rfc2047(line);
1786 1786
 	if(copy == NULL)
1787
-		return -1;
1787
+		/* an RFC checker would return -1 here */
1788
+		copy = strdup(line);
1788 1789
 
1789 1790
 	tokenseparater[0] = *separater;
1790 1791
 	tokenseparater[1] = '\0';
... ...
@@ -3485,7 +3489,7 @@ rfc2047(const char *in)
3485 3485
 		encoding = tolower(encoding);
3486 3486
 
3487 3487
 		if((encoding != 'q') && (encoding != 'b')) {
3488
-			cli_warnmsg("Unsupported RFC2047 encoding type '%c' - if you believe this file contains a virus, report it to bugs@clamav.net\n", encoding);
3488
+			cli_warnmsg("Unsupported RFC2047 encoding type '%c' - if you believe this file contains a virus that was missed, report it to bugs@clamav.net\n", encoding);
3489 3489
 			free(out);
3490 3490
 			out = NULL;
3491 3491
 			break;