Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2001 22:29:53 -0700 (PDT)
From:      Ming Zhang <ming@unixbox.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   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
Message-ID:  <200107230529.f6N5TrJ19204@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 22 22:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107230529.f6N5TrJ19204>