[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] mhfixmsg on a pathological mail

From: Ralph Corderoy
Subject: Re: [Nmh-workers] mhfixmsg on a pathological mail
Date: Sat, 19 Aug 2017 23:39:02 +0100

Hi Ken,

> Huh, the HEADERS have ^M on them?

I've reproduced similar symptoms with an mhbuild-produced email where I
tacked on CR to the end of every line after the blank line after the
headers.  IOW, without the headers having CR.  However, I still think
this is an invalid format email;  why should we handle CR at any
location?  The content shouldn't be truncated without an error exit
status though.

In InitMultiPart(), there's

    1184     while ((gotlen = getline(&bufp, &buflen, fp)) != -1) { 
    1185         if (pos > last)
    1186             break;
    1188         pos += gotlen;
    1189         if (bufp[0] != '-' || bufp[1] != '-')
    1190             continue;
    1191         if (inout) {
    1192             if (strcmp (bufp + 2, m->mp_start))
    1193                 continue;

At 1192, mp_start has been built from the boundary, e.g.  "-----
=_aaaaaaaaaa0\n", but getline() has correctly delivered a bufp[] ending
"\r\n".  This may not be the only location where this can happen.

Cheers, Ralph.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]