bin/49096: cron(8) may segfault when system open file table is full

Dmitry Sivachenko mitya at cavia.pp.ru
Wed Apr 30 07:50:23 PDT 2003


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

From: Dmitry Sivachenko <mitya at cavia.pp.ru>
To: freebsd-gnats-submit at FreeBSD.org
Cc: eugen at grosbein.pp.ru
Subject: Re: bin/49096: cron(8) may segfault when system open file table is full
Date: Wed, 30 Apr 2003 18:45:33 +0400

 Does the following patch fix the problem?
 
 
 --- do_command.c.orig	Fri May  4 04:59:40 2001
 +++ do_command.c	Wed Apr 30 18:41:48 2003
 @@ -369,13 +369,14 @@ child_process(e, u)
  
  	/*local*/{
  		register FILE	*in = fdopen(stdout_pipe[READ_PIPE], "r");
 -		register int	ch = getc(in);
 +		register int	ch;
  
  		if (in == NULL) {
  			warn("fdopen failed in child");
  			_exit(ERROR_EXIT);
  		}
  
 +		ch = getc(in);
  		if (ch != EOF) {
  			register FILE	*mail;
  			register int	bytes = 1;


More information about the freebsd-bugs mailing list