From 21992fd126e071a560f99159904f75f351929485 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Wed, 18 May 2005 20:34:14 +0000 Subject: [PATCH] Extract TNEF portions even when the filename can't be determined git-svn: trunk@1554 --- clamav-devel/ChangeLog | 6 ++++++ clamav-devel/libclamav/blob.c | 8 +++++--- clamav-devel/libclamav/tnef.c | 7 ++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/clamav-devel/ChangeLog b/clamav-devel/ChangeLog index 452d312ec..56fc2419b 100644 --- a/clamav-devel/ChangeLog +++ b/clamav-devel/ChangeLog @@ -1,3 +1,9 @@ +Wed May 18 21:31:34 BST 2005 (njh) +---------------------------------- + * libclamav: Extract TNEF files even when the filename isn't known - problem + reported by John Miller (contact at + glideslopesoftware.co.uk) + Mon May 16 23:02:13 CEST 2005 (tk) ---------------------------------- * freshclam/manager.c: remove superfluous close(hostfd), thanks to Pavel V. diff --git a/clamav-devel/libclamav/blob.c b/clamav-devel/libclamav/blob.c index 5689fde2c..81512f91a 100644 --- a/clamav-devel/libclamav/blob.c +++ b/clamav-devel/libclamav/blob.c @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char const rcsid[] = "$Id: blob.c,v 1.41 2005/04/23 10:33:44 nigelhorne Exp $"; +static char const rcsid[] = "$Id: blob.c,v 1.42 2005/05/18 20:29:45 nigelhorne Exp $"; #if HAVE_CONFIG_H #include "clamav-config.h" @@ -361,10 +361,12 @@ fileblobDestroy(fileblob *fb) assert(fb->b.data == NULL); } else if(fb->b.data) { - cli_errmsg("fileblobDestroy: file not saved: report to bugs@clamav.net\n"); free(fb->b.data); - if(fb->b.name) + if(fb->b.name) { + cli_errmsg("fileblobDestroy: %s not saved: report to bugs@clamav.net\n", fb->b.name); free(fb->b.name); + } else + cli_errmsg("fileblobDestroy: file not saved (%lu bytes): report to bugs@clamav.net\n", fb->b.len); } #ifdef CL_DEBUG fb->b.magic = INVALIDCLASS; diff --git a/clamav-devel/libclamav/tnef.c b/clamav-devel/libclamav/tnef.c index 7ffef4512..c2328954b 100644 --- a/clamav-devel/libclamav/tnef.c +++ b/clamav-devel/libclamav/tnef.c @@ -24,7 +24,7 @@ #include "clamav-config.h" #endif -static char const rcsid[] = "$Id: tnef.c,v 1.22 2005/05/12 12:39:57 nigelhorne Exp $"; +static char const rcsid[] = "$Id: tnef.c,v 1.23 2005/05/18 20:29:44 nigelhorne Exp $"; #include #include @@ -184,6 +184,11 @@ cli_tnef(const char *dir, int desc) } while(!alldone); if(fb) { + cli_dbgmsg("cli_tnef: flushing final data\n"); + if(fileblobGetFilename(fb) == NULL) { + cli_dbgmsg("Saving TNEF portion with an unknown name"); + fileblobSetFilename(fb, dir, "unknownTNEFfile"); + } fileblobDestroy(fb); fb = NULL; }