summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src/headers.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/src/headers.c')
-rw-r--r--contrib/sendmail/src/headers.c51
1 files changed, 7 insertions, 44 deletions
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c
index dd871ea..890c280 100644
--- a/contrib/sendmail/src/headers.c
+++ b/contrib/sendmail/src/headers.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: headers.c,v 8.266.4.7 2003/09/03 21:32:20 ca Exp $")
+SM_RCSID("@(#)$Id: headers.c,v 8.266.4.5 2003/03/12 22:42:52 gshapiro Exp $")
static size_t fix_mime_header __P((HDR *, ENVELOPE *));
static int priencode __P((char *));
@@ -140,10 +140,7 @@ chompheader(line, pflag, hdrp, e)
mid = (unsigned char) macid(p);
if (bitset(0200, mid))
- {
p += strlen(macname(mid)) + 2;
- SM_ASSERT(p <= q);
- }
else
p++;
@@ -318,7 +315,6 @@ hse:
qval[l++] = '"';
/* - 3 to avoid problems with " at the end */
- /* should be sizeof(qval), not MAXNAME */
for (k = 0; fvalue[k] != '\0' && l < MAXNAME - 3; k++)
{
switch (fvalue[k])
@@ -1179,7 +1175,7 @@ crackaddr(addr, e)
else if (c == ')')
{
/* syntax error: unmatched ) */
- if (copylev > 0 && SM_HAVE_ROOM && bp > bufhead)
+ if (copylev > 0 && SM_HAVE_ROOM)
bp--;
}
@@ -1353,7 +1349,7 @@ crackaddr(addr, e)
else if (SM_HAVE_ROOM)
{
/* syntax error: unmatched > */
- if (copylev > 0 && bp > bufhead)
+ if (copylev > 0)
bp--;
quoteit = true;
continue;
@@ -1697,12 +1693,6 @@ put_vanilla_header(h, v, mci)
int l;
l = nlp - v;
-
- /*
- ** XXX This is broken for SPACELEFT()==0
- ** However, SPACELEFT() is always > 0 unless MAXLINE==1.
- */
-
if (SPACELEFT(obuf, obp) - 1 < (size_t) l)
l = SPACELEFT(obuf, obp) - 1;
@@ -1713,8 +1703,6 @@ put_vanilla_header(h, v, mci)
if (*v != ' ' && *v != '\t')
*obp++ = ' ';
}
-
- /* XXX This is broken for SPACELEFT()==0 */
(void) sm_snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
(int) (SPACELEFT(obuf, obp) - 1), v);
putxline(obuf, strlen(obuf), mci, putflags);
@@ -1749,7 +1737,6 @@ commaize(h, p, oldstyle, mci, e)
int omax;
bool firstone = true;
int putflags = PXLF_HEADER;
- char **res;
char obuf[MAXLINE + 3];
/*
@@ -1766,8 +1753,6 @@ commaize(h, p, oldstyle, mci, e)
obp = obuf;
(void) sm_snprintf(obp, SPACELEFT(obuf, obp), "%.200s: ",
h->h_field);
-
- /* opos = strlen(obp); */
opos = strlen(h->h_field) + 2;
if (opos > 202)
opos = 202;
@@ -1800,23 +1785,14 @@ commaize(h, p, oldstyle, mci, e)
while ((isascii(*p) && isspace(*p)) || *p == ',')
p++;
name = p;
- res = NULL;
for (;;)
{
auto char *oldp;
char pvpbuf[PSBUFSIZE];
- res = prescan(p, oldstyle ? ' ' : ',', pvpbuf,
- sizeof pvpbuf, &oldp, NULL);
+ (void) prescan(p, oldstyle ? ' ' : ',', pvpbuf,
+ sizeof pvpbuf, &oldp, NULL);
p = oldp;
-#if _FFR_IGNORE_BOGUS_ADDR
- /* ignore addresses that can't be parsed */
- if (res == NULL)
- {
- name = p;
- continue;
- }
-#endif /* _FFR_IGNORE_BOGUS_ADDR */
/* look to see if we have an at sign */
while (*p != '\0' && isascii(*p) && isspace(*p))
@@ -1839,15 +1815,6 @@ commaize(h, p, oldstyle, mci, e)
p--;
if (++p == name)
continue;
-
- /*
- ** if prescan() failed go a bit backwards; this is a hack,
- ** there should be some better error recovery.
- */
-
- if (res == NULL && p > name &&
- !((isascii(*p) && isspace(*p)) || *p == ',' || *p == '\0'))
- --p;
savechar = *p;
*p = '\0';
@@ -1891,7 +1858,7 @@ commaize(h, p, oldstyle, mci, e)
(void) sm_strlcpy(obp, ",\n", SPACELEFT(obuf, obp));
putxline(obuf, strlen(obuf), mci, putflags);
obp = obuf;
- (void) sm_strlcpy(obp, " ", sizeof obuf);
+ (void) sm_strlcpy(obp, " ", sizeof obp);
opos = strlen(obp);
obp += opos;
opos += strlen(name);
@@ -1907,10 +1874,7 @@ commaize(h, p, oldstyle, mci, e)
firstone = false;
*p = savechar;
}
- if (obp < &obuf[sizeof obuf])
- *obp = '\0';
- else
- obuf[sizeof obuf - 1] = '\0';
+ *obp = '\0';
putxline(obuf, strlen(obuf), mci, putflags);
}
/*
@@ -1982,7 +1946,6 @@ fix_mime_header(h, e)
return 0;
/* Split on each ';' */
- /* find_character() never returns NULL */
while ((end = find_character(begin, ';')) != NULL)
{
char save = *end;
OpenPOWER on IntegriCloud