Text/plain now handled as no encoding

git-svn: trunk@1158
remotes/push_mirror/metadata
Nigel Horne 21 years ago
parent 528c8a2def
commit 8a892c3b59
  1. 23
      clamav-devel/libclamav/mbox.c
  2. 11
      clamav-devel/libclamav/text.c
  3. 4
      clamav-devel/libclamav/text.h

@ -17,6 +17,9 @@
*
* Change History:
* $Log: mbox.c,v $
* Revision 1.198 2004/12/04 16:03:55 nigelhorne
* Text/plain now handled as no encoding
*
* Revision 1.197 2004/12/04 15:50:39 nigelhorne
* Handle text/rfc822-headers incorrectly sent as message/rfc822-headers
*
@ -579,7 +582,7 @@
* Compilable under SCO; removed duplicate code with message.c
*
*/
static char const rcsid[] = "$Id: mbox.c,v 1.197 2004/12/04 15:50:39 nigelhorne Exp $";
static char const rcsid[] = "$Id: mbox.c,v 1.198 2004/12/04 16:03:55 nigelhorne Exp $";
#if HAVE_CONFIG_H
#include "clamav-config.h"
@ -1009,7 +1012,7 @@ cli_mbox(const char *dir, int desc, unsigned int options)
* of code I want to avoid
*/
(void)cli_chomp(buffer);
/*
* Ignore leading CR, e.g. if newlines are LFCR instead
* or CRLF
@ -1347,8 +1350,8 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t
mimeType = messageGetMimeType(mainMessage);
mimeSubtype = messageGetMimeSubtype(mainMessage);
subtype = tableFind(subtypeTable, mimeSubtype);
/* pre-process */
subtype = tableFind(subtypeTable, mimeSubtype);
if((mimeType == TEXT) && (subtype == PLAIN)) {
/*
* This is effectively no encoding, notice that we
@ -1375,18 +1378,8 @@ parseEmailBody(message *messageIn, text *textIn, const char *dir, const table_t
aText = textAddMessage(aText, mainMessage);
break;
case TEXT:
if(subtype == PLAIN)
/*
* Consider what to do if this fails
* (i.e. aText == NULL):
* We mustn't just return since that could
* cause a virus to be missed that we
* could be capable of scanning. Ignoring
* the error is probably the safest, we may be
* able to scan anyway and we lose nothing
*/
aText = textCopy(messageGetBody(mainMessage));
else if((options&CL_SCAN_MAILURL) && (subtype == HTML))
/* text/plain has been preprocessed as no encoding */
if((options&CL_SCAN_MAILURL) && (subtype == HTML))
checkURLs(mainMessage, dir);
break;
case MULTIPART:

@ -16,6 +16,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: text.c,v $
* Revision 1.12 2004/12/04 16:03:55 nigelhorne
* Text/plain now handled as no encoding
*
* Revision 1.11 2004/11/27 21:54:26 nigelhorne
* Tidy
*
@ -42,14 +45,14 @@
*
*/
static char const rcsid[] = "$Id: text.c,v 1.11 2004/11/27 21:54:26 nigelhorne Exp $";
static char const rcsid[] = "$Id: text.c,v 1.12 2004/12/04 16:03:55 nigelhorne Exp $";
#if HAVE_CONFIG_H
#include "clamav-config.h"
#endif
#include <stdlib.h>
#if C_DARWIN
#ifdef C_DARWIN
#include <sys/types.h>
#include <sys/malloc.h>
#else
@ -70,6 +73,8 @@ static char const rcsid[] = "$Id: text.c,v 1.11 2004/11/27 21:54:26 nigelhorne E
#include "text.h"
#include "others.h"
static text *textCopy(const text *t_head);
void
textDestroy(text *t_head)
{
@ -95,7 +100,7 @@ textClean(text *t_head)
}
/* Clone the current object */
text *
static text *
textCopy(const text *t_head)
{
text *first = NULL, *last = NULL;

@ -16,6 +16,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: text.h,v $
* Revision 1.7 2004/12/04 16:03:55 nigelhorne
* Text/plain now handled as no encoding
*
* Revision 1.6 2004/08/22 10:34:24 nigelhorne
* Use fileblob
*
@ -39,7 +42,6 @@ typedef struct text {
void textDestroy(text *t_head);
text *textClean(text *t_head);
text *textCopy(const text *t_head);
text *textAdd(text *t_head, const text *t);
text *textAddMessage(text *aText, message *aMessage);
blob *textToBlob(const text *t, blob *b);

Loading…
Cancel
Save