From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18048 invoked from network); 9 Oct 1998 15:34:41 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 9 Oct 1998 15:34:41 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id LAA14864; Fri, 9 Oct 1998 11:22:59 -0400 (EDT) Resent-Date: Fri, 9 Oct 1998 11:22:59 -0400 (EDT) From: "Bart Schaefer" Message-Id: <981009082623.ZM24827@candle.brasslantern.com> Date: Fri, 9 Oct 1998 08:26:22 -0700 X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-workers@math.gatech.edu Subject: PATCH: 3.1.4 segfault in restore_params MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"RA_Ji3.0.Be3.IfY7s"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4421 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu The core dump is obviously a null pointer dereference, so the following is a minimal fix, but I wonder how the null value got into the restorelist in the first place? (Circumstances below the patch.) Index: Src/exec.c --- exec.c 1998/09/18 17:06:53 1.2 +++ exec.c 1998/10/09 15:22:54 @@ -1971,8 +1971,8 @@ } } else paramtab->addnode(paramtab, pm->nam, pm); - if (pm->flags & PM_EXPORTED) - pm->env = addenv(pm->nam, getsparam(pm->nam)); + if ((pm->flags & PM_EXPORTED) && ((s = getsparam(pm->nam)))) + pm->env = addenv(pm->nam, s); } } } I have a little function called "cvs": ---------- #! /usr/local/bin/zsh -f cvsroot case $1 in diff|log|status) command cvs -n $* ;; *) command cvs $* ;; esac ---------- It calls a function called "cvsroot" to determine the correct value for the CVSROOT environment variable: ---------- #!/usr/local/bin/zsh -f if [[ ! -d CVS ]] then return 1 exit 1 fi if [[ -z "$CVSROOT" || ! -d "$CVSROOT"/CVSROOT ]] then if [[ -f CVS/Root ]] then CVSROOT=$(