Browse code

Handle empty content-disposition types

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

Nigel Horne authored on 2004/03/20 00:42:15
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Fri Mar 19 15:50:47 GMT 2004 (njh)
2
+----------------------------------
3
+  * libclamav/mbox.c:	Handle empty content-disposition headers
4
+
1 5
 Fri Mar 19 16:00:51 CET 2004 (tk)
2 6
 ---------------------------------
3 7
   * libclamav: small cosmetic fixes in format strings, also added some
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.54  2004/03/19 15:40:45  nigelhorne
21
+ * Handle empty content-disposition types
22
+ *
20 23
  * Revision 1.53  2004/03/19 08:08:02  nigelhorne
21 24
  * If a message part of a multipart contains an RFC822 message that has no encoding don't scan it
22 25
  *
... ...
@@ -150,7 +153,7 @@
150 150
  * Compilable under SCO; removed duplicate code with message.c
151 151
  *
152 152
  */
153
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.53 2004/03/19 08:08:02 nigelhorne Exp $";
153
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.54 2004/03/19 15:40:45 nigelhorne Exp $";
154 154
 
155 155
 #if HAVE_CONFIG_H
156 156
 #include "clamav-config.h"
... ...
@@ -1713,8 +1716,11 @@ parseMimeHeader(message *m, const char *cmd, const table_t *rfc821Table, const c
1713 1713
 			messageSetEncoding(m, copy);
1714 1714
 			break;
1715 1715
 		case CONTENT_DISPOSITION:
1716
-			messageSetDispositionType(m, strtok_r(copy, ";", &strptr));
1717
-			messageAddArgument(m, strtok_r(NULL, "\r\n", &strptr));
1716
+			arg = strtok_r(copy, ";", &strptr);
1717
+			if(arg && *arg) {
1718
+				messageSetDispositionType(m, arg);
1719
+				messageAddArgument(m, strtok_r(NULL, "\r\n", &strptr));
1720
+			}
1718 1721
 	}
1719 1722
 	free(ptr);
1720 1723