NetBSD-Bugs archive

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

Re: bin/54433: cron keeps crashing



The following reply was made to PR bin/54433; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/54433: cron keeps crashing
Date: Sat, 3 Aug 2019 06:46:17 -0000 (UTC)

 htodd%twofifty.com@localhost writes:
 
 >Here's the backtrace:
 >#0  0x0000000107407a6b in safe_p (s=0x0, usernm=0x7189072ae7c8 "root")
 >    at /usr/src/external/bsd/cron/bin/cron/../../dist/do_command.c:662
 >#1  read_data (e=e@entry=0x7189072b3700, mailto=0x0, usernm=usernm@entry=0x7189072ae7c8 "root", envp=envp@entry=0x7189072b3b40,
 
 When mailto is an empty string, a NULL pointer is passed to safe_p().
 This can happen when MAILTO is explicitely configured to be empty.
 
 Previously the code (do_command.c 1.9) checked mailto before calling
 safe_p.
 
 Maybe:
 
 Index: do_command.c
 ===================================================================
 RCS file: /cvsroot/src/external/bsd/cron/dist/do_command.c,v
 retrieving revision 1.13
 diff -p -u -r1.13 do_command.c
 --- do_command.c        14 Jun 2018 22:04:28 -0000      1.13
 +++ do_command.c        3 Aug 2019 06:45:55 -0000
 @@ -182,7 +182,7 @@ read_data(entry *e, const char *mailto, 
         /*
          * Unsafe, disable mailing.
          */
 -       if (!safe_p(usernm, mailto))
 +       if (mailto && !safe_p(usernm, mailto))
                 mailto = NULL;
  
         /* if we are supposed to be mailing, MAILTO will
 
 -- 
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index