Handle multipart messages that have no text portion

git-svn: trunk@95
remotes/push_mirror/metadata
Nigel Horne 22 years ago
parent 2a785df779
commit 294d077469
  1. 5
      clamav-devel/ChangeLog
  2. 22
      clamav-devel/libclamav/mbox.c

@ -1,3 +1,8 @@
Tue Nov 4 08:27:00 GMT 2003 (njh)
----------------------------------
* libclamav: Handle multipart messages that have no text portion
(Fix by NJH, Bug notified by Laurent Wacrenier <lwa@teaser.fr>)
Tue Nov 4 00:37:03 CET 2003 (tk)
---------------------------------
* clamd: fixed signature counter (thanks to Dirk Kraemer)

@ -17,6 +17,9 @@
*
* Change History:
* $Log: mbox.c,v $
* Revision 1.16 2003/11/04 08:24:00 nigelhorne
* Handle multipart messages that have no text portion
*
* Revision 1.15 2003/10/12 20:13:49 nigelhorne
* Use NO_STRTOK_R consistent with message.c
*
@ -36,7 +39,7 @@
* Compilable under SCO; removed duplicate code with message.c
*
*/
static char const rcsid[] = "$Id: mbox.c,v 1.15 2003/10/12 20:13:49 nigelhorne Exp $";
static char const rcsid[] = "$Id: mbox.c,v 1.16 2003/11/04 08:24:00 nigelhorne Exp $";
#ifndef CL_DEBUG
/*#define NDEBUG /* map CLAMAV debug onto standard */
@ -649,7 +652,8 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
switch(tableFind(subtypeTable, mimeSubtype)) {
case RELATED:
/*
* Look for the text bit
* Have a look to see if there's HTML code
* which will need scanning
*/
aMessage = NULL;
assert(multiparts > 0);
@ -660,9 +664,9 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
aText = textAddMessage(aText, messages[htmltextPart]);
else
/*
* There isn't a text bit. If there's a
* multipart bit, it'll probably be in
* there somewhere
* There isn't an HTML bit. If there's a
* multipart bit, it'll may be in there
* somewhere
*/
for(i = 0; i < multiparts; i++)
if(messageGetMimeType(messages[i]) == MULTIPART) {
@ -671,9 +675,11 @@ insert(message *mainMessage, blob **blobsIn, int nBlobs, text *textIn, const cha
break;
}
assert(htmltextPart != -1);
rc = insert(aMessage, blobs, nBlobs, aText, dir, rfc821Table, subtypeTable);
if(htmltextPart == -1) {
cli_dbgmsg("No HTML code found to be scanned");
rc = 0;
} else
rc = insert(aMessage, blobs, nBlobs, aText, dir, rfc821Table, subtypeTable);
blobArrayDestroy(blobs, nBlobs);
blobs = NULL;
nBlobs = 0;

Loading…
Cancel
Save