summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src/mime.c
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2001-01-21 22:17:06 +0000
committergshapiro <gshapiro@FreeBSD.org>2001-01-21 22:17:06 +0000
commitc5e098efbef941858129b84a112a036d572ba53c (patch)
tree277ca53e5c12bcf1d38feccf7fd364839dbf811a /contrib/sendmail/src/mime.c
parentf1e9c33a3410fd42927853cf01fb4279382f2bcf (diff)
parent167a83e7b8733416154f871e39e86ba77eb1554d (diff)
downloadFreeBSD-src-c5e098efbef941858129b84a112a036d572ba53c.zip
FreeBSD-src-c5e098efbef941858129b84a112a036d572ba53c.tar.gz
This commit was generated by cvs2svn to compensate for changes in r71345,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/sendmail/src/mime.c')
-rw-r--r--contrib/sendmail/src/mime.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/sendmail/src/mime.c b/contrib/sendmail/src/mime.c
index e92f615..2ba078f 100644
--- a/contrib/sendmail/src/mime.c
+++ b/contrib/sendmail/src/mime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1994, 1996-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1994
@@ -15,7 +15,7 @@
#include <string.h>
#ifndef lint
-static char id[] = "@(#)$Id: mime.c,v 8.94 1999/10/17 17:35:58 ca Exp $";
+static char id[] = "@(#)$Id: mime.c,v 8.94.16.3 2000/10/09 02:46:10 gshapiro Exp $";
#endif /* ! lint */
static int isboundary __P((char *, char **));
@@ -277,8 +277,10 @@ mime8to7(mci, header, e, boundaries, flags)
if (tTd(43, 1))
dprintf("mime8to7: multipart boundary \"%s\"\n", bbuf);
for (i = 0; i < MAXMIMENESTING; i++)
+ {
if (boundaries[i] == NULL)
break;
+ }
if (i >= MAXMIMENESTING)
{
usrerr("mime8to7: multipart nesting boundary too deep");
@@ -621,7 +623,7 @@ mime8to7(mci, header, e, boundaries, flags)
linelen++;
}
}
- if (bitnset(c1 & 0xff, badchars))
+ if (bitnset(bitidx(c1), badchars))
{
*bp++ = '=';
*bp++ = Base16Code[(c1 >> 4) & 0x0f];
@@ -828,11 +830,11 @@ mimeboundary(line, boundaries)
if (line[0] != '-' || line[1] != '-' || boundaries == NULL)
return MBT_NOTSEP;
i = strlen(line);
- if (line[i - 1] == '\n')
+ if (i > 0 && line[i - 1] == '\n')
i--;
/* strip off trailing whitespace */
- while (line[i - 1] == ' ' || line[i - 1] == '\t')
+ while (i > 0 && (line[i - 1] == ' ' || line[i - 1] == '\t'))
i--;
savec = line[i];
line[i] = '\0';
@@ -904,7 +906,7 @@ isboundary(line, boundaries)
{
register int i;
- for (i = 0; boundaries[i] != NULL; i++)
+ for (i = 0; i <= MAXMIMENESTING && boundaries[i] != NULL; i++)
{
if (strcmp(line, boundaries[i]) == 0)
return i;
OpenPOWER on IntegriCloud