Bug 29156

Summary: crontab core dumps when install a cron table from a file which contains an empty line, ie, only contains \n or \r\n
Product: Base System Reporter: ming <ming>
Component: binAssignee: dd <dd>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description ming 2001-07-23 06:30:01 UTC
crontab calls load_entry() load the file.  When an error is detected
in a line of the file, for example, an empty line (\n or \r\n), 
load_entry() jumps to eof: which then calls free_entry(), in
free_entry(), env_free(e->envp) is called, however at this point,
e->envp is NULL, thus causes crontab to coredump.

Fix: 

entry.c:

change env_free (e->envp) to 

if (e->envp) env_free (e->envp);
How-To-Repeat: create a file with an empty line and feed it to crontab
Comment 1 dd freebsd_committer freebsd_triage 2001-07-23 07:37:40 UTC
State Changed
From-To: open->analyzed

Fixed four days ago in rev. 1.13. 


Comment 2 dd freebsd_committer freebsd_triage 2001-07-23 07:37:40 UTC
Responsible Changed
From-To: freebsd-bugs->dd

My MFC reminder.
Comment 3 Crist J. Clark 2001-07-23 08:11:46 UTC
On Sun, Jul 22, 2001 at 10:29:53PM -0700, Ming Zhang wrote:
> 
> >Number:         29156
> >Category:       bin
> >Synopsis:       crontab core dumps when install a cron table from a file which contains an empty line, ie, only contains \n or \r\n

Looks like dd fixed this in CURRENT a week or two ago. MFC the fixes?
-- 
Crist J. Clark                           cjclark@alum.mit.edu
Comment 4 dima 2001-07-23 08:22:28 UTC
"Crist J. Clark" <cristjc@earthlink.net> writes:
> On Sun, Jul 22, 2001 at 10:29:53PM -0700, Ming Zhang wrote:
> > 
> > >Number:         29156
> > >Category:       bin
> >Synopsis:       crontab core dumps when install a cron table from a file whi
> ch contains an empty line, ie, only contains \n or \r\n
> 
> Looks like dd fixed this in CURRENT a week or two ago. MFC the fixes?

I will, before the freeze/slush for sure, probably in a day or two.

> -- 
> Crist J. Clark                           cjclark@alum.mit.edu
>
Comment 5 dd freebsd_committer freebsd_triage 2001-07-30 17:55:36 UTC
State Changed
From-To: analyzed->closed

fixed