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) Tue Nov 4 00:37:03 CET 2003 (tk)
--------------------------------- ---------------------------------
* clamd: fixed signature counter (thanks to Dirk Kraemer) * clamd: fixed signature counter (thanks to Dirk Kraemer)

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

Loading…
Cancel
Save