Browse code

Some HTML.Phishing.Bank-1 were getting through

git-svn: trunk@2086

Nigel Horne authored on 2006/07/16 05:34:35
Showing 2 changed files
... ...
@@ -1,3 +1,9 @@
1
+Sat Jul 15 21:33:22 BST 2006 (njh)
2
+----------------------------------
3
+  * libclamav/message.c:	Some HTML.Phishing.Bank-1 were getting through,
4
+					  Fix by Torok Edvin
5
+					  <edwintorok*gmail.com>
6
+
1 7
 Sat Jul 15 00:15:17 CEST 2006 (tk)
2 8
 ----------------------------------
3 9
   * freshclam/manager.c: initial support for incremental updates
... ...
@@ -16,7 +16,7 @@
16 16
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 17
  *  MA 02110-1301, USA.
18 18
  */
19
-static	char	const	rcsid[] = "$Id: message.c,v 1.178 2006/07/03 09:19:15 njh Exp $";
19
+static	char	const	rcsid[] = "$Id: message.c,v 1.179 2006/07/15 20:32:49 njh Exp $";
20 20
 
21 21
 #if HAVE_CONFIG_H
22 22
 #include "clamav-config.h"
... ...
@@ -1277,14 +1277,14 @@ messageExport(message *m, const char *dir, void *(*create)(void), void (*destroy
1277 1277
 		 * Set len to be the data fork length
1278 1278
 		 */
1279 1279
 		dataforklen = ((data[byte] << 24) & 0xFF000000) |
1280
-		      ((data[byte + 1] << 16) & 0xFF0000) |
1281
-		      ((data[byte + 2] << 8) & 0xFF00) |
1282
-		      (data[byte + 3] & 0xFF);
1280
+			((data[byte + 1] << 16) & 0xFF0000) |
1281
+			((data[byte + 2] << 8) & 0xFF00) |
1282
+			(data[byte + 3] & 0xFF);
1283 1283
 
1284 1284
 		resourceforklen = ((data[byte + 4] << 24) & 0xFF000000) |
1285
-		      ((data[byte + 5] << 16) & 0xFF0000) |
1286
-		      ((data[byte + 6] << 8) & 0xFF00) |
1287
-		      (data[byte + 7] & 0xFF);
1285
+			((data[byte + 5] << 16) & 0xFF0000) |
1286
+			((data[byte + 6] << 8) & 0xFF00) |
1287
+			(data[byte + 7] & 0xFF);
1288 1288
 
1289 1289
 		cli_dbgmsg("Filename = '%s', data fork length = %lu, resource fork length = %lu bytes\n",
1290 1290
 			filename, dataforklen, resourceforklen);
... ...
@@ -1911,8 +1911,19 @@ decodeLine(message *m, encoding_type et, const char *line, unsigned char *buf, s
1911 1911
 						break;
1912 1912
 					}
1913 1913
 
1914
-					byte <<= 4;
1915
-					byte += hex(*line);
1914
+					/*
1915
+					 * Fix by Torok Edvin
1916
+					 * <edwintorok@gmail.com>
1917
+					 * Handle messages that use a broken
1918
+					 * quoted-printable encoding of
1919
+					 * href=\"http://, instead of =3D
1920
+					 */
1921
+					if(byte != '=') {
1922
+						byte <<= 4;
1923
+						byte += hex(*line);
1924
+					} else
1925
+						line -= 2;
1926
+
1916 1927
 					*buf++ = byte;
1917 1928
 				} else
1918 1929
 					*buf++ = *line;