Browse code

Handle empty content-type fields

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

Nigel Horne authored on 2004/12/11 00:23:43
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Fri Dec 10 15:21:48 GMT 2004 (njh)
2
+----------------------------------
3
+  * libclamav/message.c:	Warn if the content-type contains a blank entry
4
+		e.g. "Content-Type: text/html /"
5
+
1 6
 Wed Dec  8 01:12:12 CET 2004 (tk)
2 7
 ---------------------------------
3 8
   * docs/MacOSX: update (Dale Enterprise L.L.C)
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: message.c,v $
20
+ * Revision 1.129  2004/12/10 15:20:23  nigelhorne
21
+ * Handle empty content-type fields
22
+ *
20 23
  * Revision 1.128  2004/12/01 12:12:27  nigelhorne
21 24
  * Part of rule 3 of paragraph 5.1 of RFC1521 was not being implemented
22 25
  *
... ...
@@ -381,7 +384,7 @@
381 381
  * uuencodebegin() no longer static
382 382
  *
383 383
  */
384
-static	char	const	rcsid[] = "$Id: message.c,v 1.128 2004/12/01 12:12:27 nigelhorne Exp $";
384
+static	char	const	rcsid[] = "$Id: message.c,v 1.129 2004/12/10 15:20:23 nigelhorne Exp $";
385 385
 
386 386
 #if HAVE_CONFIG_H
387 387
 #include "clamav-config.h"
... ...
@@ -574,7 +577,10 @@ messageSetMimeType(message *mess, const char *type)
574 574
 	int typeval;
575 575
 
576 576
 	assert(mess != NULL);
577
-	assert(type != NULL);
577
+	if(type == NULL) {
578
+		cli_warnmsg("Empty content-type field\n");
579
+		return 0;
580
+	}
578 581
 
579 582
 	cli_dbgmsg("messageSetMimeType: '%s'\n", type);
580 583