From owner-freebsd-stable Thu Jul 12 7:42: 8 2001 Delivered-To: freebsd-stable@freebsd.org Received: from alpo.whistle.com (s206m1.whistle.com [207.76.206.1]) by hub.freebsd.org (Postfix) with ESMTP id D905137B401; Thu, 12 Jul 2001 07:42:01 -0700 (PDT) (envelope-from mark@whistle.com) Received: from [207.76.207.129] (PBG4.whistle.com [207.76.207.129]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id HAA00937; Thu, 12 Jul 2001 07:41:36 -0700 (PDT) Mime-Version: 1.0 X-Sender: mark-ml@207.76.206.1 Message-Id: In-Reply-To: <200107120602.f6C628T41618@earth.backplane.com> References: <1399129667.20010709164730@mail.ru> <006e01c10927$c3151d80$6d36120a@comsys.ntukpi.kiev.ua> <18810557330.20010711121320@mail.ru> <86itgz4eyf.fsf@hades.hell.gr> <20010711224709.11607.qmail@panda.freebsdsystems.com> <200107120602.f6C628T41618@earth.backplane.com> Date: Thu, 12 Jul 2001 07:37:37 -0700 To: freebsd-questions@FreeBSD.ORG, stable@FreeBSD.ORG From: Mark Peek Subject: Re: cron exited on signal 11 Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 11:02 PM -0700 7/11/01, Matt Dillon wrote: > Well this certainly opens up a can of worms! Not your patch, but what > it implies. For example, env_set() assumes envp is not NULL as well. > In fact, most of the code assumes envp is not NULL, and 99% of the time > that is true due to the env_init() calls. > > I found at least one case in the code where free_entry() is called with > e->envp == NULL. Perhaps a more correct fix would simply be to have > free_entry() check for e->envp != NULL before calling env_free() rather > then having env_free() check for NULL. > > It would be great if the original poster could try this patch rather > then the above patch to see if it also fixes the problem. > > -Matt > >Index: lib/entry.c >=================================================================== >RCS file: /home/ncvs/src/usr.sbin/cron/lib/entry.c,v >retrieving revision 1.12 >diff -u -r1.12 entry.c >--- lib/entry.c 2001/06/13 05:49:37 1.12 >+++ lib/entry.c 2001/07/12 05:59:54 >@@ -74,7 +74,8 @@ > free(e->class); > #endif > free(e->cmd); >- env_free(e->envp); >+ if (e->envp != NULL) >+ env_free(e->envp); > free(e); > } Matt, I see your point about env_set() and env_free() being orthogonal wrt envp != NULL. I also contemplated making the same change you made above. However, I thought it was better to have free() style semantics and allow env_free() to properly handle a NULL pointer. ("Be liberal in what you accept...") Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message