nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Segfault in post from mime quoted names in aliases

2017-04-12 15:00:58
I just added a second mime-encoded entry to my aliases file and then `post`
seg-faulted. Only one entry seems to be ok.

This alias file is enough to cause this:

n1: =?iso-8859-1?Q?gnillen?= <johan(_dot_)viklund(_at_)nbis(_dot_)se>
n2: =?iso-8859-1?Q?gnillen?= <johan(_dot_)viklund(_at_)nbis(_dot_)se>

With only n1 it works, with both of them it segfaults (even on current HEAD).
It does not seem to matter what I enter in the 'To' field.

Oh, ha-ha!  How ... unexpected.  Looks like this bug has been around for
approximately forever!  I think any two group-base aliases would have
triggered it.

Here's the line that triggers the bug.  For this code, "gr" is the value
returned from getgrnam() or getgrgid().  See the problem?

    while ((gp = *gr->gr_mem++))

If you don't get it, here's a hint: getgrnam() and getgrgid() are not
thread-safe.

Fixing this should be relatively easy.  But ... is this code useful,
now?  With the encoding schemes that exist today, you might want to put
an = sign in an email address, and really, how often are you sending
email to a Unix group?  BTW, in testing this I accidentally sent an
email to the work "root" mailing list because of Ralph's noted use of
atoi() meant that anything weird ends up calling getgrgid(0); luckily
those people have a sense of humor.

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>