From a9f73834e9932f46a4aac4a1b09cdd78b0d7ae82 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 19 Jan 1997 16:16:03 +0000 Subject: Avoid core dump in rewrite logic. svn path=/trunk/; revision=787 --- rfc822.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'rfc822.c') 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); -- cgit v1.2.3