Browse code

Handle comments in the command part of headers

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

Nigel Horne authored on 2004/11/27 21:02:36
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sat Nov 27 12:01:03 GMT 2004 (njh)
2
+----------------------------------
3
+ * libclamav/mbox.c:	Handle RFC822 comments in the commands, e.g.:
4
+				Co(foo)ntent-Type: text/plain
5
+
1 6
 Fri Nov 26 23:00:42 GMT 2004 (njh)
2 7
 ----------------------------------
3 8
  * libclamav/mbox.c:	Scan binHexes after the final MIME section
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.186  2004/11/27 11:59:28  nigelhorne
21
+ * Handle comments in the command part of headers
22
+ *
20 23
  * Revision 1.185  2004/11/26 23:00:29  nigelhorne
21 24
  * Handle spaces after the final MIME boundary and binHex attachments after that boundary
22 25
  *
... ...
@@ -543,7 +546,7 @@
543 543
  * Compilable under SCO; removed duplicate code with message.c
544 544
  *
545 545
  */
546
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.185 2004/11/26 23:00:29 nigelhorne Exp $";
546
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.186 2004/11/27 11:59:28 nigelhorne Exp $";
547 547
 
548 548
 #if HAVE_CONFIG_H
549 549
 #include "clamav-config.h"
... ...
@@ -1049,6 +1052,8 @@ parseEmailHeaders(const message *m, const table_t *rfc821)
1049 1049
 		else
1050 1050
 			buffer = NULL;
1051 1051
 
1052
+		cli_dbgmsg("parseEmailHeaders: check '%s'\n", buffer ? buffer : "");
1053
+
1052 1054
 		if(inHeader) {
1053 1055
 			if((buffer == NULL) && !contMarker) {
1054 1056
 				/*
... ...
@@ -1088,7 +1093,10 @@ parseEmailHeaders(const message *m, const table_t *rfc821)
1088 1088
 						continue;
1089 1089
 					}
1090 1090
 
1091
-					commandNumber = tableFind(rfc821, cmd);
1091
+					ptr = rfc822comments(cmd);
1092
+					commandNumber = tableFind(rfc821, ptr ? ptr : cmd);
1093
+					if(ptr)
1094
+						free(ptr);
1092 1095
 
1093 1096
 					switch(commandNumber) {
1094 1097
 						case CONTENT_TRANSFER_ENCODING: