Browse code

Extract TNEF portions even when the filename can't be determined

git-svn: trunk@1554

Nigel Horne authored on 2005/05/19 05:34:14
Showing 3 changed files
... ...
@@ -1,3 +1,9 @@
1
+Wed May 18 21:31:34 BST 2005 (njh)
2
+----------------------------------
3
+  * libclamav:	Extract TNEF files even when the filename isn't known - problem
4
+			reported by John Miller (contact at
5
+			glideslopesoftware.co.uk)
6
+
1 7
 Mon May 16 23:02:13 CEST 2005 (tk)
2 8
 ----------------------------------
3 9
   * freshclam/manager.c: remove superfluous close(hostfd), thanks to Pavel V.
... ...
@@ -15,7 +15,7 @@
15 15
  *  along with this program; if not, write to the Free Software
16 16
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
  */
18
-static	char	const	rcsid[] = "$Id: blob.c,v 1.41 2005/04/23 10:33:44 nigelhorne Exp $";
18
+static	char	const	rcsid[] = "$Id: blob.c,v 1.42 2005/05/18 20:29:45 nigelhorne Exp $";
19 19
 
20 20
 #if HAVE_CONFIG_H
21 21
 #include "clamav-config.h"
... ...
@@ -361,10 +361,12 @@ fileblobDestroy(fileblob *fb)
361 361
 
362 362
 		assert(fb->b.data == NULL);
363 363
 	} else if(fb->b.data) {
364
-		cli_errmsg("fileblobDestroy: file not saved: report to bugs@clamav.net\n");
365 364
 		free(fb->b.data);
366
-		if(fb->b.name)
365
+		if(fb->b.name) {
366
+			cli_errmsg("fileblobDestroy: %s not saved: report to bugs@clamav.net\n", fb->b.name);
367 367
 			free(fb->b.name);
368
+		} else
369
+			cli_errmsg("fileblobDestroy: file not saved (%lu bytes): report to bugs@clamav.net\n", fb->b.len);
368 370
 	}
369 371
 #ifdef	CL_DEBUG
370 372
 	fb->b.magic = INVALIDCLASS;
... ...
@@ -24,7 +24,7 @@
24 24
 #include "clamav-config.h"
25 25
 #endif
26 26
 
27
-static	char	const	rcsid[] = "$Id: tnef.c,v 1.22 2005/05/12 12:39:57 nigelhorne Exp $";
27
+static	char	const	rcsid[] = "$Id: tnef.c,v 1.23 2005/05/18 20:29:44 nigelhorne Exp $";
28 28
 
29 29
 #include <stdio.h>
30 30
 #include <fcntl.h>
... ...
@@ -184,6 +184,11 @@ cli_tnef(const char *dir, int desc)
184 184
 	} while(!alldone);
185 185
 
186 186
 	if(fb) {
187
+		cli_dbgmsg("cli_tnef: flushing final data\n");
188
+		if(fileblobGetFilename(fb) == NULL) {
189
+			cli_dbgmsg("Saving TNEF portion with an unknown name");
190
+			fileblobSetFilename(fb, dir, "unknownTNEFfile");
191
+		}
187 192
 		fileblobDestroy(fb);
188 193
 		fb = NULL;
189 194
 	}