diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2002-11-26 04:05:38 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2002-11-26 04:05:38 +0000 |
commit | 7151a63fcce316840de99b2da8bcdb03d61a770a (patch) | |
tree | 06336afc068aaf034e82261451d548cf7135d6e6 /transact.c | |
parent | 7db567f3850c996437f732522ea2f7de2914b019 (diff) | |
download | fetchmail-7151a63fcce316840de99b2da8bcdb03d61a770a.tar.gz fetchmail-7151a63fcce316840de99b2da8bcdb03d61a770a.tar.bz2 fetchmail-7151a63fcce316840de99b2da8bcdb03d61a770a.zip |
Ready to ship.
svn path=/trunk/; revision=3771
Diffstat (limited to 'transact.c')
-rw-r--r-- | transact.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -339,6 +339,14 @@ static int sizeticker; #define EMPTYLINE(s) ((s)[0] == '\r' && (s)[1] == '\n' && (s)[2] == '\0') +static int end_of_header (const char *s) +/* accept "\r*\n" as EOH in order to be bulletproof against broken survers */ +{ + while (s[0] == '\r') + s++; + return (s[0] == '\n' && s[1] == '\0'); +} + int readheaders(int sock, long fetchlen, long reallen, @@ -476,7 +484,7 @@ int readheaders(int sock, } /* check for end of headers */ - if (EMPTYLINE(line)) + if (end_of_header(line)) { headers_ok = TRUE; has_nuls = (linelen != strlen(line)); @@ -506,10 +514,12 @@ int readheaders(int sock, */ if (!isspace(line[0]) && !strchr(line, ':')) { - headers_ok = FALSE; - has_nuls = (linelen != strlen(line)); - free(line); - goto process_headers; + /* the headers_ok flag cannot be set to FALSE here as the + * delimiter has not occurred yet. */ + if (outlevel > O_SILENT) + report(stdout, + GT_("incorrect header line found while scanning headers\n")); + retain_mail = 1; } /* check for RFC822 continuations */ |