From owner-cvs-bin Wed Sep 20 01:31:07 1995 Return-Path: owner-cvs-bin Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA24068 for cvs-bin-outgoing; Wed, 20 Sep 1995 01:31:07 -0700 Received: (from davidg@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA24055 ; Wed, 20 Sep 1995 01:31:00 -0700 Date: Wed, 20 Sep 1995 01:31:00 -0700 From: David Greenman Message-Id: <199509200831.BAA24055@freefall.freebsd.org> To: cvs-bin, CVS-commiters Subject: cvs commit: src/bin/sh eval.c Sender: owner-cvs-bin@FreeBSD.org Precedence: bulk davidg 95/09/20 01:30:59 Modified: bin/sh eval.c Log: Don't dereference a NULL pointer in the case of a null pipe. e.g.: ls |> foo.out sh now behaves the same as it does under SunOS 4.x for this case. From owner-cvs-bin Wed Sep 20 01:34:57 1995 Return-Path: owner-cvs-bin Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA24261 for cvs-bin-outgoing; Wed, 20 Sep 1995 01:34:57 -0700 Received: (from davidg@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA24252 ; Wed, 20 Sep 1995 01:34:50 -0700 Date: Wed, 20 Sep 1995 01:34:50 -0700 From: David Greenman Message-Id: <199509200834.BAA24252@freefall.freebsd.org> To: cvs-bin, CVS-commiters Subject: cvs commit: src/bin/sh eval.c Sender: owner-cvs-bin@FreeBSD.org Precedence: bulk davidg 95/09/20 01:34:49 Branch: bin/sh RELENG_2_1_0 Modified: bin/sh eval.c Log: Brought in change from rev 1.4: don't dereference a NULL pointer in null pipes. From owner-cvs-bin Thu Sep 21 06:24:30 1995 Return-Path: owner-cvs-bin Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id GAA05832 for cvs-bin-outgoing; Thu, 21 Sep 1995 06:24:30 -0700 Received: (from bde@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id GAA05821 ; Thu, 21 Sep 1995 06:24:22 -0700 Date: Thu, 21 Sep 1995 06:24:22 -0700 From: Bruce Evans Message-Id: <199509211324.GAA05821@freefall.freebsd.org> To: cvs-bin, CVS-commiters Subject: cvs commit: src/bin/sh jobs.c Sender: owner-cvs-bin@FreeBSD.org Precedence: bulk bde 95/09/21 06:24:21 Modified: bin/sh jobs.c Log: Fix relocation of job table. while { sleep 1 & wait; } do echo 1; done corrupted the job table every 4th iteration. From owner-cvs-bin Thu Sep 21 06:38:53 1995 Return-Path: owner-cvs-bin Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id GAA06129 for cvs-bin-outgoing; Thu, 21 Sep 1995 06:38:53 -0700 Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id GAA06122 ; Thu, 21 Sep 1995 06:38:37 -0700 Received: from corbin.Root.COM (corbin [198.145.90.34]) by Root.COM (8.6.12/8.6.5) with ESMTP id GAA21085; Thu, 21 Sep 1995 06:37:21 -0700 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.12/8.6.5) with SMTP id GAA00413; Thu, 21 Sep 1995 06:39:46 -0700 Message-Id: <199509211339.GAA00413@corbin.Root.COM> To: Bruce Evans cc: cvs-bin@freefall.freebsd.org, CVS-commiters@freefall.freebsd.org Subject: Re: cvs commit: src/bin/sh jobs.c In-reply-to: Your message of "Thu, 21 Sep 95 06:24:22 PDT." <199509211324.GAA05821@freefall.freebsd.org> From: David Greenman Reply-To: davidg@Root.COM Date: Thu, 21 Sep 1995 06:39:46 -0700 Sender: owner-cvs-bin@FreeBSD.org Precedence: bulk >bde 95/09/21 06:24:21 > > Modified: bin/sh jobs.c > Log: > Fix relocation of job table. > > while { sleep 1 & wait; } do echo 1; done > > corrupted the job table every 4th iteration. Hmmm... *************** *** 459,465 **** --- 459,472 ---- if (njobs == 0) { jobtab = ckmalloc(4 * sizeof jobtab[0]); } else { + struct job *ojp; + jp = ckmalloc((njobs + 4) * sizeof jobtab[0]); + for (i = njobs, ojp = jobtab; --i >= 0; + jp++, ojp++) + if (ojp->ps == &ojp->ps0) + ojp->ps = &jp->ps0; + jp -= njobs; bcopy(jobtab, jp, njobs * sizeof jp[0]); ckfree(jobtab); jobtab = jp; I'm concerned by what you're doing with 'jp' above. How is free() going to be able to free this after you've changed the address that was returned by malloc (jp -= njobs)? -DG