aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-19 16:16:03 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-19 16:16:03 +0000
commita9f73834e9932f46a4aac4a1b09cdd78b0d7ae82 (patch)
treebb53280bd9ec9c9b43b4d1d3470bfc9a3532c8a1
parent9c429358cf6723ae869e9578c89e6c74efdddd77 (diff)
downloadfetchmail-a9f73834e9932f46a4aac4a1b09cdd78b0d7ae82.tar.gz
fetchmail-a9f73834e9932f46a4aac4a1b09cdd78b0d7ae82.tar.bz2
fetchmail-a9f73834e9932f46a4aac4a1b09cdd78b0d7ae82.zip
Avoid core dump in rewrite logic.
svn path=/trunk/; revision=787
-rw-r--r--rfc822.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rfc822.c b/rfc822.c
index e940f700..94b60c7f 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -48,7 +48,7 @@ const char *host; /* server hostname */
else if (*from == ')')
--parendepth;
- if (!parendepth)
+ if (!parendepth && !has_host_part)
switch (state)
{
case 0: /* before header colon */
@@ -65,8 +65,10 @@ const char *host; /* server hostname */
{
while (isspace(*from))
--from;
+ from++;
while (isspace(*buf))
--buf;
+ buf++;
strcpy(buf, "@");
strcat(buf, host);
buf += strlen(buf);