Browse code

Handle spaces before colons

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

Nigel Horne authored on 2004/09/16 07:11:50
Showing 2 changed files
... ...
@@ -1,3 +1,9 @@
1
+Wed Sep 15 23:09:39 BST 2004 (njh)
2
+----------------------------------
3
+  * libclamav/mbox.c:	FOLLOWURLS: check if normalisation is successful
4
+		Scan for viruses where the mail has spaces before the colon
5
+		after the 'Content-Transfer-Encoding'
6
+
1 7
 Wed Sep 15 21:44:01 CEST 2004 (tk)
2 8
 ----------------------------------
3 9
   * freshclam: add support for version verification and additional protection
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: mbox.c,v $
20
+ * Revision 1.122  2004/09/15 22:09:26  nigelhorne
21
+ * Handle spaces before colons
22
+ *
20 23
  * Revision 1.121  2004/09/15 18:08:23  nigelhorne
21 24
  * Handle multiple encoding types
22 25
  *
... ...
@@ -351,7 +354,7 @@
351 351
  * Compilable under SCO; removed duplicate code with message.c
352 352
  *
353 353
  */
354
-static	char	const	rcsid[] = "$Id: mbox.c,v 1.121 2004/09/15 18:08:23 nigelhorne Exp $";
354
+static	char	const	rcsid[] = "$Id: mbox.c,v 1.122 2004/09/15 22:09:26 nigelhorne Exp $";
355 355
 
356 356
 #if HAVE_CONFIG_H
357 357
 #include "clamav-config.h"
... ...
@@ -868,7 +871,7 @@ parseEmailHeader(message *m, const char *line, const table_t *rfc821)
868 868
 
869 869
 	cmd = strtok_r(copy, ":", &strptr);
870 870
 
871
-	if(cmd && *cmd) {
871
+	if(cmd && (strstrip(cmd) > 0)) {
872 872
 		char *arg = strtok_r(NULL, "", &strptr);
873 873
 
874 874
 		if(arg)
... ...
@@ -2147,19 +2150,22 @@ checkURLs(message *m, const char *dir)
2147 2147
 	}
2148 2148
 
2149 2149
 	t = tableCreate();
2150
+	if(t == NULL) {
2151
+		blobDestroy(b);
2152
+		return;
2153
+	}
2150 2154
 
2151 2155
 	hrefs.count = 0;
2152 2156
 	hrefs.tag = hrefs.value = NULL;
2153 2157
 
2154 2158
 	cli_dbgmsg("checkURLs: calling html_normalise_mem\n");
2155
-	html_normalise_mem(blobGetData(b), len, NULL, &hrefs);
2156
-	cli_dbgmsg("checkURLs: html_normalise_mem returned\n");
2157
-
2158
-	/*if(href == NULL) {
2159
+	if(!html_normalise_mem(blobGetData(b), len, NULL, &hrefs)) {
2159 2160
 		blobDestroy(b);
2160 2161
 		tableDestroy(t);
2161 2162
 		return;
2162
-	}*/
2163
+	}
2164
+	cli_dbgmsg("checkURLs: html_normalise_mem returned\n");
2165
+
2163 2166
 	/* TODO: Do we need to call remove_html_comments? */
2164 2167
 
2165 2168
 	n = 0;