aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in2
-rw-r--r--NEWS9
-rw-r--r--fetchmail.man20
-rw-r--r--rfc822.c53
4 files changed, 42 insertions, 42 deletions
diff --git a/Makefile.in b/Makefile.in
index f2e586e3..e547a3ff 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -4,7 +4,7 @@
# So just uncomment all the lines marked QNX.
PACKAGE = fetchmail
-VERSION = 5.8.5
+VERSION = 5.8.6
# Ultrix 2.2 make doesn't expand the value of VPATH.
srcdir = @srcdir@
diff --git a/NEWS b/NEWS
index 1a081148..b114a559 100644
--- a/NEWS
+++ b/NEWS
@@ -2,12 +2,19 @@
(The `lines' figures total .c, .h, .l, and .y files under version control.)
+fetchmail-5.8.6 (Tue Jun 12 08:16:54 EDT 2001), 20676 lines:
+
* Reject candidate headers for the MAIL FROM address that have \n in them.
* Add capability to insert poll trace data in the Received line.
+* HMH's patch to prevent buffer overflow due to long headers. Addresses
+ Debian bug #100394.
+* Brendan Kehoe's patch to avoid doing DNS lookups on skip entries.
+
+There are 347 people on fetchmail-friends and 592 on fetchmail-announce.
fetchmail-5.8.5 (Tue May 29 20:01:39 EDT 2001), 20650 lines:
-* Interface option fix from Alexander Kourakov.
+* Interface option fix from Alexander Kourakos.
* Fixes for i18n glitches and new Danish translation from Byrial Jensen.
* Attempted fix for Harry McGavran's problems with the Kerberos V build.
* Added fetchmailnochda.pl to the contrib directory.
diff --git a/fetchmail.man b/fetchmail.man
index 075907d3..c71cadd9 100644
--- a/fetchmail.man
+++ b/fetchmail.man
@@ -1826,23 +1826,9 @@ loonytoons.org or toons.org domains (including subdomain addresses like
`joe@daffy.loonytoons.org') should be passed through to the local SMTP
listener without modification. Be careful of mail loops if you do this!
.PP
-Here's an example configuration using ssh. The queries go through an
-ssh connecting local port 1234 to port 110 on mailhost.net; the
-preconnect command sets up the ssh.
-
-.nf
-poll mailhost.net via localhost port 1234 with proto pop3:
- user esr is esr here
- preconnect "ssh -f -L 1234:mailhost.net:110
- mailhost.net sleep 20 </dev/null >/dev/null";
-.fi
-
-.PP
-Here's an example configuration using ssh and the plugin option (this
-method is better, as it doesn't require the IMAP port to be open on
-the server). The queries are made directly on the stdin and stdout of
-imapd via ssh. Note that in this setup, IMAP authentication can be
-skipped.
+Here's an example configuration using ssh and the plugin option. The
+queries are made directly on the stdin and stdout of imapd via ssh.
+Note that in this setup, IMAP authentication can be skipped.
.nf
poll mailhost.net with proto imap:
diff --git a/rfc822.c b/rfc822.c
index 5315f1b6..4724b8e2 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -16,7 +16,7 @@
#include "fetchmail.h"
#include "i18n.h"
-#define HEADER_END(p) ((p)[0] == '\n' && ((p)[1] != ' ' && (p)[1] != '\t'))
+#define HEADER_END(p) ((p)[0] == '\n' && ((p)[1] != ' ' && (p)[1] != '\t' && (p)[1] != '\0'))
#ifdef TESTMAIN
static int verbose;
@@ -190,7 +190,8 @@ unsigned char *nxtaddr(hdr)
/* parse addresses in succession out of a specified RFC822 header */
const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr */
{
- static unsigned char *tp, address[POPBUFSIZE+1];
+ static unsigned char address[POPBUFSIZE+1];
+ static int tp;
static const unsigned char *hp;
static int state, oldstate;
#ifdef TESTMAIN
@@ -206,6 +207,8 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
#define INSIDE_BRACKETS 5 /* inside bracketed address */
#define ENDIT_ALL 6 /* after last address */
+#define NEXTTP() ((tp < sizeof(address)-1) ? tp++ : tp)
+
if (hdr)
{
hp = hdr;
@@ -213,7 +216,7 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
#ifdef TESTMAIN
orighdr = hdr;
#endif /* TESTMAIN */
- tp = address;
+ tp = 0;
}
for (; *hp; hp++)
@@ -231,20 +234,22 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
else if (HEADER_END(hp))
{
state = ENDIT_ALL;
- if (tp > address)
+ if (tp)
{
- while (isspace(*--tp))
+ while (isspace(address[--tp]))
continue;
- *++tp = '\0';
+ address[++tp] = '\0';
+ tp = 0;
+ return (address);
}
- return(tp > address ? (tp = address) : (unsigned char *)NULL);
+ return((unsigned char *)NULL);
}
else if (*hp == '\\') /* handle RFC822 escaping */
{
if (state != INSIDE_PARENS)
{
- *tp++ = *hp++; /* take the escape */
- *tp++ = *hp; /* take following unsigned char */
+ address[NEXTTP()] = *hp++; /* take the escape */
+ address[NEXTTP()] = *hp; /* take following unsigned char */
}
}
else switch (state)
@@ -259,7 +264,7 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
{
oldstate = SKIP_JUNK;
state = INSIDE_DQUOTE;
- *tp++ = *hp;
+ address[NEXTTP()] = *hp;
}
else if (*hp == '(') /* address comment -- ignore */
{
@@ -270,7 +275,7 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
else if (*hp == '<') /* begin <address> */
{
state = INSIDE_BRACKETS;
- tp = address;
+ tp = 0;
}
else if (*hp != ',' && !isspace(*hp))
{
@@ -282,11 +287,12 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
case BARE_ADDRESS: /* collecting address without delimiters */
if (*hp == ',') /* end of address */
{
- if (tp > address)
+ if (tp)
{
- *tp++ = '\0';
+ address[NEXTTP()] = '\0';
state = SKIP_JUNK;
- return(tp = address);
+ tp = 0;
+ return(address);
}
}
else if (*hp == '(') /* beginning of comment */
@@ -298,18 +304,18 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
else if (*hp == '<') /* beginning of real address */
{
state = INSIDE_BRACKETS;
- tp = address;
+ tp = 0;
}
else if (!isspace(*hp)) /* just take it, ignoring whitespace */
- *tp++ = *hp;
+ address[NEXTTP()] = *hp;
break;
case INSIDE_DQUOTE: /* we're in a quoted string, copy verbatim */
if (*hp != '"')
- *tp++ = *hp;
+ address[NEXTTP()] = *hp;
else
{
- *tp++ = *hp;
+ address[NEXTTP()] = *hp;
state = oldstate;
}
break;
@@ -326,21 +332,22 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
case INSIDE_BRACKETS: /* possible <>-enclosed address */
if (*hp == '>') /* end of address */
{
- *tp++ = '\0';
+ address[NEXTTP()] = '\0';
state = SKIP_JUNK;
++hp;
- return(tp = address);
+ tp = 0;
+ return(address);
}
else if (*hp == '<') /* nested <> */
- tp = address;
+ tp = 0;
else if (*hp == '"') /* quoted address */
{
- *tp++ = *hp;
+ address[NEXTTP()] = *hp;
oldstate = INSIDE_BRACKETS;
state = INSIDE_DQUOTE;
}
else /* just copy address */
- *tp++ = *hp;
+ address[NEXTTP()] = *hp;
break;
}
}