From nobody@FreeBSD.org  Sun Jul 22 22:29:53 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id A553D37B406
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 22 Jul 2001 22:29:53 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f6N5TrJ19204;
	Sun, 22 Jul 2001 22:29:53 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200107230529.f6N5TrJ19204@freefall.freebsd.org>
Date: Sun, 22 Jul 2001 22:29:53 -0700 (PDT)
From: Ming Zhang <ming@unixbox.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: crontab core dumps when install a cron table from a file which contains an empty line, ie, only contains \n or \r\n
X-Send-Pr-Version: www-1.0

>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
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 22 22:30:01 PDT 2001
>Closed-Date:    Mon Jul 30 09:55:36 PDT 2001
>Last-Modified:  Mon Jul 30 09:56:01 PDT 2001
>Originator:     Ming Zhang
>Release:        3.4-stable
>Organization:
>Environment:
FreeBSD shell.unixbox.com 4.3-STABLE FreeBSD 4.3-STABLE #0: Sun Jul 22 20:07:37 PDT 2001     ming@shell.unixbox.com:/usr/src/sys/compile/unixbox  i386

>Description:
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.
>How-To-Repeat:
create a file with an empty line and feed it to crontab
>Fix:
entry.c:

change env_free (e->envp) to 

if (e->envp) env_free (e->envp);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dd 
State-Changed-When: Sun Jul 22 23:37:40 PDT 2001 
State-Changed-Why:  
Fixed four days ago in rev. 1.13. 


Responsible-Changed-From-To: freebsd-bugs->dd 
Responsible-Changed-By: dd 
Responsible-Changed-When: Sun Jul 22 23:37:40 PDT 2001 
Responsible-Changed-Why:  
My MFC reminder. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29156 

From: "Crist J. Clark" <cristjc@earthlink.net>
To: Ming Zhang <ming@unixbox.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG, dd@FreeBSD.ORG
Subject: Re: bin/29156: crontab core dumps when install a cron table from a file which contains an empty line, ie, only contains \n or \r\n
Date: Mon, 23 Jul 2001 00:11:46 -0700

 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

From: Dima Dorfman <dima@unixfreak.org>
To: cjclark@alum.mit.edu
Cc: Ming Zhang <ming@unixbox.com>, freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/29156: crontab core dumps when install a cron table from a file which contains an empty line, ie, only contains \n or \r\n 
Date: Mon, 23 Jul 2001 00:22:28 -0700

 "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
 > 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dd 
State-Changed-When: Mon Jul 30 09:55:36 PDT 2001 
State-Changed-Why:  
fixed 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29156 
>Unformatted:
