On Tue, Nov 06, 2007 at 08:41:08PM +1100, Chris wrote:

> On 11/6/07, Otto Moerbeek <[EMAIL PROTECTED]> wrote:
> > I'd like a copy of your /etc/mailer.conf file. Probably it trips a bug
> > in mailwrapper.
> 
> Thanks. I had a look in my /etc/mailer.conf and it read -
> 
> /usr/local/sbin/postfix-enable, which I changed to the following
> (exactly as my 4.1 box) -
> 
> sendmail    /usr/libexec/sendmail/sendmail
> send-mail   /usr/libexec/sendmail/sendmail
> mailq         /usr/libexec/sendmail/sendmail
> newaliases /usr/libexec/sendmail/sendmail
> hoststat /usr/libexec/sendmail/sendmail
> purgestat /usr/libexec/sendmail/sendmail
> 
> And I ran "newaliases" again and it says -
> 
> No local mailer defined
> QueueDirectory (Q) option must be set. I then restored the 4.1
> sendmail.cf to /etc/mail and ran newaliases again and the output is
> looking good now -
> 
> /etc/mail/newaliases: 43 aliases, longest 10 bytes, 618 bytes total.
> 
> Thanks.

This diff fixes the core dump in case there's only one string on a line.

        -Otto

Index: mailwrapper.c
===================================================================
RCS file: /cvs/src/usr.sbin/mailwrapper/mailwrapper.c,v
retrieving revision 1.17
diff -u -p -r1.17 mailwrapper.c
--- mailwrapper.c       2 Sep 2007 15:19:39 -0000       1.17
+++ mailwrapper.c       6 Nov 2007 09:51:09 -0000
@@ -125,7 +125,7 @@ main(int argc, char *argv[], char *envp[
                        continue;
                }
 
-               if ((from = strsep(&cp, WS)) == NULL)
+               if ((from = strsep(&cp, WS)) == NULL || cp == NULL)
                        goto parse_error;
 
                cp += strspn(cp, WS);

Reply via email to