Browse code

Handle uuencoded files created with buggy software

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

Nigel Horne authored on 2004/06/25 06:37:26
Showing 1 changed files
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: message.c,v $
20
+ * Revision 1.62  2004/06/24 21:37:26  nigelhorne
21
+ * Handle uuencoded files created with buggy software
22
+ *
20 23
  * Revision 1.61  2004/06/22 04:08:02  nigelhorne
21 24
  * Optimise empty lines
22 25
  *
... ...
@@ -180,7 +183,7 @@
180 180
  * uuencodebegin() no longer static
181 181
  *
182 182
  */
183
-static	char	const	rcsid[] = "$Id: message.c,v 1.61 2004/06/22 04:08:02 nigelhorne Exp $";
183
+static	char	const	rcsid[] = "$Id: message.c,v 1.62 2004/06/24 21:37:26 nigelhorne Exp $";
184 184
 
185 185
 #if HAVE_CONFIG_H
186 186
 #include "clamav-config.h"
... ...
@@ -1230,9 +1233,15 @@ messageToBlob(message *m)
1230 1230
 		unsigned char *uptr;
1231 1231
 		const char *line = t_line->t_text;
1232 1232
 
1233
-		if(messageGetEncoding(m) == UUENCODE)
1233
+		if(messageGetEncoding(m) == UUENCODE) {
1234
+			/*
1235
+			 * There should be no blank lines in uuencoded files...
1236
+			 */
1237
+			if(line == NULL)
1238
+				continue;
1234 1239
 			if(strcasecmp(line, "end") == 0)
1235 1240
 				break;
1241
+		}
1236 1242
 
1237 1243
 		uptr = decodeLine(m, line, data, sizeof(data));
1238 1244